scottsweb / wp-instagram-widget

❌ A WordPress widget for showing your latest Instagram photos.
115 stars 62 forks source link

WP Instagram Widget

WP Instagram Widget

About

WP Instagram widget is a no fuss WordPress widget to showcase your latest Instagram pics. It does not require you to provide your login details or sign in via oAuth.

The widget is built with the following philosophy:

Installation

To install this plugin:

Alternatively you can search for the plugin from your WordPress dashboard and install from there.

Visit WordPress.org for a comprehensive guide on in how to install WordPress plugins.

Hooks & Filters

The plugin has five filters. The first allows you adjust that cache time for retrieving the images from Instagram:

add_filter('null_instagram_cache_time', 'my_cache_time');

function my_cache_time() {
    return HOUR_IN_SECONDS;
}

The second allows you to filter video results from the widget:

add_filter('wpiw_images_only', '__return_true');

The rest allow you to add custom classes to the [ul] list container, each list item, link or image:

add_filter( 'wpiw_list_class', 'my_instagram_class' );

add_filter( 'wpiw_item_class', 'my_instagram_class' );
add_filter( 'wpiw_a_class', 'my_instagram_class' );
add_filter( 'wpiw_img_class', 'my_instagram_class' );
add_filter( 'wpiw_linka_class', 'my_instagram_class' );

function my_instagram_class( $classes ) {
    $classes = "instagram-image";
    return $classes;
}

In version 1.3 you also have two new hooks for adding custom output before and after the widget:

wpiw_before_widget
wpiw_after_widget

In version 1.4 and above you can also customise the image loop completely by creating a parts/wp-instagram-widget.php file in your theme.

In version 1.9.6 you can now use a filter to change the location of your custom template part: wpiw_template_part.

Frequently Asked Questions

...

Changelog

2.0.4

2.0.3

2.0.2

2.0.1

2.0.0

1.9.8

1.9.7

1.9.6

1.9.5

1.9.4

1.9.3

1.9.2

1.9.1

1.9

1.8.1

1.8

1.7

1.6

1.5.1

1.5

1.4

1.3.1

1.3

1.2.1

1.2

1.1

1.0