CM Answers (CMA) - Shortcodes - Using Shortcodes

Using Shortcodes

You can insert dynamic content on your WordPress website by using the plugin's shortcodes. Note that they are always written between brackets [] and are case-sensitive.

The up-to-date list of all shortcode can be found in the plugin admin menu. 


Supported Shortcodes in Detail

[cma-questions]

Use: Shows the questions table

Filtering parameters:
  • author - ID of the question author (default: empty) [Question only]
  • limit - number of questions per page to display, default is 5
  • contributor - ID of the question author or user who has answered for the question (default: empty) [Question only]
  • cat - slug of category (categories separate by commas) (default: empty)
  • answered - show only unanswered (0) or only answered (1) questions. Default: empty (all questions).
  • resolved - show only unresolved (0) or only resolved (1) questions. Default: empty (all questions).
  • subtree - limit the categories filter options only to subcategories of the current category given by the cat parameter (default: 0)
  • displaycategories - display category name next to the question (default: 0)
View parameters:
  • ajax - enable or disable AJAX support (default: 1)
  • sort - one of following: newest, hottest, views, votes (default: newest)
  • form - add "question form" (default: 0)
  • formontop - display the question form above the questions table (default: 0)
  • dateposted - display the thread posted date (default: 0)
  • showcontent - display the question's content below the title when showcontent=1 or fragment when showcontent=fragment (default: 0)
  • search - add "search form" above list (default: 1)
  • pagination - show pagination (default: 1)
  • hidequestions - hides the question list (default: 0)
  • votes - show the number of votes (default: 1)
  • views - show the number of views (default: 1)
  • answers - show the number of answers (default: 1)
  • updated - show the information about question's last update (default: 1)
  • authorinfo - show the infformation about question's author (default: 1)
  • statusinfo - show the information about question's status (default: 0)
  • tags - show questions' tags (default: 1)
  • navbar - show the full navigation bar (default: 0)
  • sortbar - show the sorting bar (default: 0)
  • scrollaftersearch - scroll to the top of the container after loaded new subpage (default: 1)
Example

[cma-questions limit="10" author="123" sort="hottest" form="1"]

Sample

The forum category shortcode  [cma-questions cat="tooltipglossary" form="1" navbar="0" views="0" votes="0" updated="0" answers="0"] will result in:


[cma-index]

Use: Shows the questions table. Works the same as the [cma-questions], but has different default values that come from the  Index page settings.


[cma-my-questions]

Use: Shows current user's questions in the same way it's displayed on the contributor's page. It supports the same parameters as the [cma-questions] shortcode.


[cma-answers]

Shows the answers table

Filtering parameters:
  • author - ID of the answer author (default: empty)
  • limit - number of results per page to display, default is 5
View parameters:
  • ajax - enable or disable AJAX support (default: 1)

[cma-my-answers]

Use: Shows current user's answers in the same way it's displayed on the contributor's page.

Supported parameters:
  • ajax - enable AJAX support so clicking on the question won't reload the current page.

[cma-categories]

Use: Shows the categories table.

  • questions - shows number of questions
  • unanswered - shows unanswered questions number
  • answers - shows number of answers
  • follow - adds the Follow/Unfollow button for each category
  • header - shows table header
  • parent - shows only subcategories of given parent category (slug or ID)
Sample

Example

[cma-categories questions=1 answers=1 follow=1 header=1 unanswered=1 parent=category experts=0]


[cma-categories-list]

Use: Shows the categories list

Example

[cma-categories-list]


[cma-followed]

Use: Shows current user's followed threads and categories.


[cma-question-form]

Use: Shows the question form

Parameters:
  • cat - (optional) category's slug or term ID that the question will be posted to.
  • title - show title or not. Values: 0 or 1, default is 0.
  • backlink - show the back link or not. Values: 0 or 1, default is 1.

[cma-board]

Use: Shows questions divided by categories

Parameters:
  • showquestions - whether to show the questions. Values are 0 or 1, default is 1.
  • questionslimit - limit number of questions.

[cma-get-param-author]

Use: Returns "author" parameter from URL. E.g. if the URL is/custom-user-page/?author=123, the shortcode will return 123. 

May be used combined with the [cma-questions] or [cma-answers] shortcodes in order to create a custom contributor's page.

Examples
[cma-questions author="[cma-get-param-author]"]
[cma-answers author="[cma-get-param-author]"]

Attaching YouTube and Vimeo clips

To attach a YouTube or Vimeo clip to the thread, just put the URL in brackets. 

Example 

[https://youtu.be/Zkdf3kaso]


Get more information about the CM Answers WordPress Plugin

Find other WordPress products at the CreativeMinds WordPress Store

Let us know how we can Improve this Product Documentation Page

Visit our support center to open a Support Ticket