Below, you’ll find a detailed guide on how to add the WPZOOM Social Feed 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 WPZOOM Social Feed Widget & Block Plugin shortcode not to show or not to work correctly.
Before starting, here is an overview of the WPZOOM Social Feed Widget & Block Plugin and the shortcodes it provides:
"WPZOOM Social Feed Widget & Block is a user-friendly plugin that allows you to seamlessly integrate and display your Instagram feeds on your WordPress website, enhancing social connectivity."
- [instagram]
WPZOOM [instagram] Shortcode
The Instagram Widget by WPZoom shortcode is a powerful tool that fetches and displays Instagram feeds. It uses the ‘feed’ attribute to identify the specific feed to showcase. In case of an issue, it displays an error message in the admin panel, ensuring smooth user experience and easy troubleshooting.
Shortcode: [instagram]
Parameters
Here is a list of all possible instagram shortcode parameters and attributes:
feed
– Specifies the ID of the Instagram feed to display
Examples and Usage
Basic example – The shortcode is used to display an Instagram feed by referencing the ID of the feed.
[instagram feed=1 /]
PHP Function Code
In case you have difficulties debugging what causing issues with [instagram]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'instagram', array( $this, 'get_shortcode_output' ) );
Shortcode PHP function:
function get_shortcode_output( array $atts, string $content, string $tag ) {
if ( ! empty( $atts ) && is_array( $atts ) && array_key_exists( 'feed', $atts ) ) {
$feed_id = intval( $atts['feed'] );
if ( $feed_id > -1 ) {
return sprintf(
"<style type=\"text/css\">%s</style>\n%s",
$this->output_styles( $feed_id, false ),
$this->get_feed_output( $feed_id )
);
}
}
return is_admin() ? sprintf(
'<p class="error" style="color:red"><strong>%s</strong></p>',
esc_html__( 'There was a problem displaying the selected feed. Please check the configuration...', 'instagram-widget-by-wpzoom' )
) : '';
}
Code file location:
instagram-widget-by-wpzoom/instagram-widget-by-wpzoom/class-wpzoom-instagram-widget-display.php
Conclusion
Now that you’ve learned how to embed the WPZOOM Social Feed Widget & Block 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.
Leave a Reply