If you’re using shortcodes to display your Popular Posts, there are many different tags that you can use to change the theme and style of your Inline Popular Posts, Popular Posts widget, or Popular Products cards.
With attribute tags you can override styles such as colour (background, text, etc), add or remove titles, even change the layout by changing theme (alpha, beta, etc).
Detailed in this guide is a list of all the attribute tags that you can use to override and change the default settings:
- Inline Popular Post Shortcode
- Popular Posts Widget Shortcode
- Popular Posts Popular Products Shortcode
Prerequisites:
- Have installed and activated MonsterInsights.
- Have configured inline, widget themes.
- Have configured inline and widget sorting options.
- Are not using the Classic editor.
Example Usage
The image above shows an example of the inline Popular Posts shortcode being changed with the attributes theme, changing the theme to alpha for this post only.
Inline Popular Post Shortcode
[monsterinsights_popular_posts_inline]
Adding any of the extra attribute tags below to an existing or new Inline Popular Posts shortcodes in your blog posts allow you to modify attributes that can be set.
- 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)
Popular Posts Widget Shortcode
[monsterinsights_popular_posts_widget]
Popular Post Widget shortcode attribute tags allows you to edit the way the widget displays information 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)
Popular Posts Popular Products Shortcode
[monsterinsights_popular_posts_products]
Popular Products shortcode attribute tags allows you to change specifics about the product cards that are displayed inline on product pages.
- 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)