Social Gallery and Widget Shortcode

Below, you’ll find a detailed guide on how to add the Social Gallery and Widget Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Social Gallery and Widget Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Social Gallery and Widget Plugin and the shortcodes it provides:

Plugin Icon
Social Gallery and Widget

"Social Gallery and Widget is a dynamic WordPress plugin that allows you to effortlessly integrate and display your Instagram feed in a beautiful gallery widget, enhancing your site's social engagement."

★★★✩✩ (5) Active Installs: 20000+ Tested with: 6.3.2 PHP Version: false
Included Shortcodes:
  • [catch-instagram_feed_gallery_widget_shortcode]

Social Gallery and Widget [catch-instagram_feed_gallery_widget_shortcode] Shortcode

The ‘catch-instagram-feed-gallery-widget’ shortcode is used to display an Instagram feed on your website. It allows customization of the feed’s layout, padding, column arrangement, and more. This shortcode retrieves Instagram posts based on the username provided. It also allows you to set the number of posts to display and their resolution size. Shortcode: [catch_instagram_feed_gallery_widget_shortcode] This shortcode also enables you to set the link type and text for the feed. It ensures the feed is displayed correctly using the ‘Catch_Instagram_Feed_Gallery_Widget_Helper’ class. Shortcode: [catch_instagram_feed_gallery_widget_shortcode]

Shortcode: [catch-instagram_feed_gallery_widget_shortcode]

Parameters

Here is a list of all possible catch-instagram_feed_gallery_widget_shortcode shortcode parameters and attributes:

  • title – The title of the Instagram Gallery Widget
  • username – The username of the Instagram account
  • type – Defines the type of user
  • layout – Sets the layout style of the widget
  • padding – Adjusts the padding around the widget
  • column – Defines the number of columns in the gallery
  • number – Specifies the number of photos to display
  • size – Sets the size of the photos in the gallery
  • target – Determines where the link opens
  • link_type – Defines the type of link to use
  • link_text – Sets the text for the Instagram link
  • element – Defines the element as shortcode

Examples and Usage

Basic example – Display Instagram feed gallery widget with default settings

[catch-instagram-feed-gallery-widget /]

Advanced examples

Display Instagram feed gallery widget with a custom title and for a specific user

[catch-instagram-feed-gallery-widget title="My Instagram Gallery" username="myusername" /]

Display Instagram feed gallery widget with a custom layout, padding, and column structure

[catch-instagram-feed-gallery-widget layout="custom" padding="10" column="four-columns" /]

Display Instagram feed gallery widget with a specific number of photos, photo size, and target link type

[catch-instagram-feed-gallery-widget number="8" size="low_resolution" link_type="link_instagram" /]

Display Instagram feed gallery widget with a custom link text

[catch-instagram-feed-gallery-widget link_text="See More on Instagram" /]

These examples demonstrate the flexibility of the ‘catch-instagram-feed-gallery-widget’ shortcode. By adjusting the parameters/attributes, you can customize the Instagram feed gallery widget to suit your website’s needs.

PHP Function Code

In case you have difficulties debugging what causing issues with [catch-instagram_feed_gallery_widget_shortcode] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'catch-instagram-feed-gallery-widget', array( $this, 'catch_instagram_feed_gallery_widget_shortcode' ) );

Shortcode PHP function:

function catch_instagram_feed_gallery_widget_shortcode( $atts ) {
		// Default attributes.
		$atts = shortcode_atts(
			array(
				'title'     => esc_html__( 'Gallery and Widget for Instagram', 'catch-instagram-feed-gallery-widget' ),
				'username'  => '',
				'type'      => 'users',
				'layout'    => 'default',
				'padding'   => 0,
				'column'    => 'six-columns',
				'number'    => 6,
				'size'      => 'standard_resolution',
				'target'    => 0,
				'link_type' => 'link_site',
				'link_text' => esc_html__( 'View on Instagram', 'catch-instagram-feed-gallery-widget' ),
				'element'   => 'shortcode',
			),
			$atts,
			'catch-instagram-feed-gallery-widget'
		);

		$options = catch_instagram_feed_gallery_widget_get_options();

		// A little sanitization.
		$atts['columns'] = sanitize_text_field( $atts['title'] );

		$atts['username'] = isset( $options['username'] ) ? $options['username'] : '';

		$atts['column'] = sanitize_key( $atts['column'] );

		$atts['number'] = catch_instagram_feed_gallery_widget_sanitize_number_range( $atts['number'] );

		$atts['size'] = sanitize_key( $atts['size'] );

		$atts['element'] = 'shortcode';

		$catch_instagram_feed_gallery_widget_helper = new Catch_Instagram_Feed_Gallery_Widget_Helper();
		return $catch_instagram_feed_gallery_widget_helper->display( $atts );
	}

Code file location:

catch-instagram-feed-gallery-widget/catch-instagram-feed-gallery-widget/includes/class-catch-instagram-feed-gallery-widget-shortcode.php

Conclusion

Now that you’ve learned how to embed the Social Gallery and Widget Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *