CM Answers (CMA) - Shortcodes - Using Shortcodes

List of Shortcodes

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

Supported Shortcodes in Detail

  • You can add My Questions and My Answers profile views for your user profile anywhere on the site by using shortcodes:
  • [cma-my-questions], [cma-my-answers]. The AJAX support can be disabled by parameter ajax=0.
  • Generate questions list by using shortcode: [cma-questions]
  • Generate answers list by using shortcode: [cma-answers]
  • You can add the Categories table anywhere on the site by using shortcode: [cma-categories questions=1 answers=1 follow=1 header=1 unanswered=1 parent=category] or [cma-categories-list]
  • To display the user's followed threads and categories: [cma-followed]
  • To generate a questions index similar to the Answers main page, use: [cma-index]
  • To generate a question form use: [cma-question-form]
  • To attach a YouTube or Vimeo clip to the thread just put the URL in brackets: []

Ajax and Non Ajax shortcodes

Most shortcodes have the option to work in Ajax mode. To do so you will need to add the parameter ajax="1" to the shortcode parameters (if the Ajax mode doesn't work by default), or ajax="0" to disable the Ajax mode.

Showing Questions and Answers using a Shortcode

In the Pro edition of CM Answers, many forum category shortcodes are available for direct insertion, allowing you to display selected parts of your forum wherever you want them to appear.

Questions/Index Shortcodes have the following parameters

  • cat - slug of category (categories separated by commas) (default: empty)
  • answered - show only answered (1) or unanswered (0) questions. Default: empty ( all questions).
  • resolved –show only unresolved (0) or only resolved (1) questions. Default: empty (all questions).
  • limit - define the number of questions to display per page (default: “Questions” 5 | “My questions” -1 [no limit] )
  • author - ID of the question author (default: empty) [Question only]
  • contributor - ID of the question author or user who has answered for the question (default: empty) [Question only]
  • sort - one of following: newest, hottest, views, votes (default: newest)
  • form - add “question form” below the question list (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 (default: 0)
  • search - add “search form” above the list (default: 1)
  • pagination - show page numbers (default: 1)
  • hidequestions - hides the question list (default: 0)
  • votes - show the number of user votes for each question or answer (default: 1)
  • views - show the number of views for each forum post (default: 1)
  • answers - show the number of answers to each question (default: 1)
  • updated - show the information about question’s last update (default: 1)
  • authorinfo - show information about a question’s author (default: 1)
  • statusinfo - show information about the question’s status (default: 0)
  • navbar - show the full forum navigation bar (default: 0)
  • subtree –limit the categories filter options only to subcategories of the current category given by the cat parameter (default: 0)
  • tags - show questions' tags (default: 1)
  • displaycategories - display the category name next to each question (default: 0)
  • ajax - enable or disable AJAX support (default: 1)
  • sortbar - show the sorting bar (default: 0)

For example, the forum category shortcode [cma-questions cat="tooltipglossary" form="1" navbar="0" views="0" votes="0" updated="0" answers="0"], will produce the following output on the front end:

List All Categories Shortcode

To see a list of all available categories use cma-categories in [brackets]. This will produce the following output on the front end:

This shortcode supports the following parameters

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

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

Still need help? Contact Us Contact Us