Shortcodes Usage for Popular Posts

If you are preferring to use shortcodes as the method to display your Inline Popular Posts, Popular Posts widget, and Popular Products cards, there are many different attributes that you can change.

Listed in this guide are the attribute tags that can be added to your shortcode to change features ranging from the theme itself, colour (title, text, and background), meta data, and font sizes:

  1. Inline Popular Post Shortcode
  2. Popular Posts Widget Shortcode
  3. Popular Posts Popular Products Shortcode

Prerequisites:

  1. ExactMetrics is installed and activated.
  2. Your inline, widget themes are configured.
  3. The inline and widget sorting options are configured.
  4. You are not using the Classic editor.

Example Usage

Popular Posts Shortcode example

The example above changes the theme of the inline Popular Posts embed for just this one post, changing the theme specifically to charlie.

The attribute modifying tags below, when included with your shortcode, will change the way your Inline Popular Posts are displayed in your blog posts.

  • theme (theme name lowercase: alpha, beta, charlie, etc)
  • title_color (css color)
  • title_size (integer – in px)
  • label_color (css color)
  • label_text (string – text to display for label)
  • background_color (css color)
  • background_border (css color) – theme specific
  • border_color  (css color) – theme specific
  • border_color2  (css color) – theme specific
  • icon_color  (css color)
  • icon_background  (css color)

The following attribute tags allow for you to make changes to the Popular Posts widget that appears in the sidebar.

  • theme (theme name lowercase: alpha, beta, charlie, etc)
  • title_color (css color)
  • title_size (integer – in px)
  • label_color (css color)
  • label_text (string – text to display for label)
  • background_color (css color)
  • background_border (css color)
  • meta_color (css color)
  • meta_size (integer – in px)
  • meta_author (on/off)
  • meta_date (on/off)
  • meta_comments (on/off)
  • comments_color (css color)
  • columns (1/2/3)
  • widget_title (on/off)
  • widget_title_text (string – text to display for title)

You can change the appearance of your Popular Products cards that are displayed within your product pages by using the attribute tags listed below.

  • title_color (css color)
  • title_size (integer – in px)
  • label_color (css color)
  • label_text (string – text to display for label)
  • background_color (css color)
  • background_border (css color)
  • price_color (css color)
  • price_size (integer – in px)
  • meta_price (on/off)
  • meta_rating (on/off)
  • meta_image (on/off)
  • rating_color (css color)
  • columns (1/2/3)
  • categories (comma separated ids)