Shoppable Social Media Galleries by Sauce Shortcode

Below, you’ll find a detailed guide on how to add the Shoppable Social Media Galleries by Sauce 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 Shoppable Social Media Galleries by Sauce Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Shoppable Social Media Galleries by Sauce Plugin and the shortcodes it provides:

Plugin Icon
Shoppable Social Media Galleries by Sauce

"Shoppable Social Media Galleries by Sauce is a dynamic WordPress plugin that transforms your Instagram feed into a shoppable gallery, enhancing user engagement and boosting sales."

★★★☆✩ (37) Active Installs: 4000+ Tested with: 6.3.2 PHP Version: false
Included Shortcodes:
  • [snapppt_embed]

Shoppable Social Media Galleries by Sauce [snapppt_embed] Shortcode

The ‘snapppt_embed’ shortcode from the Shop-feed-for-instagram-by-snapppt plugin is used to embed a widget. This shortcode calls the ‘snapppt_embed_func’ function which generates a script tag. The function uses global options and shortcode attributes to define the widget’s type and account ID. If an account ID isn’t provided, an error message is displayed.

Shortcode: [snapppt_embed]

Parameters

Here is a list of all possible snapppt_embed shortcode parameters and attributes:

  • embed_type – Determines the layout of the Instagram feed on the page
  • account_id – The unique identifier for the specific Instagram account

Examples and Usage

Basic example – The basic usage of the snapppt_embed shortcode requires an account ID parameter. This ID is unique to each Snapppt account and is necessary for the plugin to pull the correct Instagram feed. If no account ID is provided, an error message will be displayed.

[snapppt_embed account_id=12345 /]

Advanced examples – The snapppt_embed shortcode allows for additional customization through the embed_type parameter. This parameter changes the layout of the Instagram feed on your site. The default embed_type is ‘grid’, but you can change it to any other supported layout by Snapppt.

[snapppt_embed account_id=12345 embed_type=carousel /]

Additionally, you can combine multiple parameters to further customize the Instagram feed. In the following example, we’re using both the account_id and embed_type parameters to display a carousel layout for a specific Snapppt account.

[snapppt_embed account_id=12345 embed_type=carousel /]

PHP Function Code

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

Shortcode line:

add_shortcode('snapppt_embed', 'snapppt_embed_func');

Shortcode PHP function:

function snapppt_embed_func($atts) {
    global $snapppt_options;
    $embed_endpoint = SNAPPPT_URL . '/widgets/widget_loader/';

    $embed_data = shortcode_atts(array(
      'embed_type' => 'grid',
      'account_id' => $snapppt_options['account_id']
    ), $atts);

    if($embed_data['account_id'] == '') {
      return "<p>[ Sauce Embed - No account ID provided! ]</p>";
    } else {
      return "<script src='" . $embed_endpoint . esc_html($embed_data['account_id']) . "/" .
        esc_html($embed_data['embed_type']) . ".js' class='snapppt-widget'></script>";
    }
  }

Code file location:

shop-feed-for-instagram-by-snapppt/shop-feed-for-instagram-by-snapppt/snapppt-frontend.php

Conclusion

Now that you’ve learned how to embed the Shoppable Social Media Galleries by Sauce 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 *