CM Product Directory (CMPD) - Shortcodes


Shortcodes

Back to User Guide

TIP: What Are Shortcodes

Shortcodes add dynamic content to your site via a small piece of code. Learn more: Shortcodes - How To Use

Table of contents

  1. Single Product Shortcode
  2. Directory Shortcode
  3. Category List
  4. Search box
  5. CM Star Rating

Single Product Shortcode

Shortcode: [cmpd_single_product]

Use: Shows a widget containing basic information about a single product on any page or post.

Parameters:

  • slug - insert the slug (the last part of the url) of the product you would like to show

Example

[cmpd_single_product slug="product-1"]


Directory Shortcode

Use: Shows a directory structure of all related product which are related to the shortcode parameters.

Shortcode: [cmpd_product]

Attributes:

  • view - the id of the view from the following: tiles, list(defaults to: tiles)
  • filter_search - whether to hide Search filter on Products Index Page  (1 means hide, 0 means show)
  • filter_category - whether to hide Categories filter on Products Index Page  (1 means hide, 0 means show)
  • filter_pricingmodel - whether to hide Pricing Model filter on Products Index Page (1 means hide, 0 means show)
  • filter_languagesupport - whether to hide Language Support filter on Products Index Page  (1 means hide, 0 means show)
  • filter_targetaudience - whether to hide Target Audience filter on Products Index Page  (1 means hide, 0 means show)
  • filter_tag - whether to hide Tags filter on Products Index Page  (1 means hide, 0 means show)
  • row_product - number of the product in the row (tiles view only)
  • page_product - number of the product on one page
  • cats - the slug of the catagory from which the product should be displayed
  • pricingmodels - the slug of additional category from which the product should be displayed
  • langsupports - the slug of additional category from which the product should be displayed
  • targetaudiences - the slug of additional category from which the product should be displayed
  • tags - the name of the tag the product displayed should have
  • only_relevant - use 1 if you like only to display the categories associated with products in the directory. Value should be 1 or 0
  • product_ids - the IDs of the product you only want to show in directory. Value should be an ID, or comma separated IDs.
  • exclude_ids - the IDs of the product you want to exclude from displaying in directory. Value should be an ID, or comma separated IDs.

Example - [cmpd_product row_product="3" cats="1" only_relevant="0" tags="onsale" product_ids="1,3,5" exclude_ids="2,4"]


Category List

Use: Displays a Category List. Can be configured with parameters 

Shortcode[cmpd_category_list]

Attributes:

  • count - Whether you want to display category elements (1 means yes, 0 means no)
  • columns - Number of columns (1-6)
  • category - Display list of Category terms  (1 means yes, 0 means no)
  • pricingmodel - Display list of Pricing Model terms  (1 means yes, 0 means no)
  • languagesupport - Display list of Language Support terms  (1 means yes, 0 means no)
  • targetaudience - Display list of Target Audience terms  (1 means yes, 0 means no)
  • tag - Display list of Tag terms  (1 means yes, 0 means no)
  • hide_empty - Whether to display categories with posts assigned (1 means yes, 0 means no)

Example

[cmpd_category_list count="1" columns ="4"]


Use: Displays search box

Shortcode: [cmpd_product_searchbox]

Attributes:

  • placeholder_text - text to be shown as default in search box

Example

Example: [cmpd_product_searchbox placeholder_text="Search"]


CM Star Rating

Use: Displays rating

Shortcode: [cmpd-star-rating]

Attributes:

  • ratingfor - whether to show rating for a specific post (post ID)
  • disablerating - whether to disable rating (1 means disable, 0 means show)
  • hideaverage - whether to hide average note (1 means hide, 0 means show)
  • hidecount - whether to hide ratings count (1 means hide, 0 means show)

Example

[cmpd-star-rating ratingfor="123"]


More information about the CM Product Directory WordPress  Plugin

Other WordPress products can be found at CreativeMinds WordPress Store

Let us know how we can Improve this Product Documentation Page

To open a Support Ticket visit our support center
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.