WordPress FAQ Plugin (CMFAQ) - Shortcodes


FAQ 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 | Finding ID of Post/Page/Other Content

This user guide covers shortcodes available in the WordPress FAQ plugin.

FAQ With All Categories

To display FAQ with all categories use the shortcode [cm_faq]

  • To show only selected lists, use the list  parameter with name or slug of the list

    [cm_faq list="general-wordpress,general-magento"]

    Displaying FAQ with all categories - FAQ Plugin WordPress
    Displaying FAQ with all categories

All Questions

Use  [cm_faq_all]  to display a list with all questions. You can further customize this list with parameters.

Parameters

  1. Show only questions from selected categories - use category  with name or slug or list of names or slugs of the categories

    [cm_faq_all category="WordPress,technology"]

    Displaying questions of chosen categories - Best FAQ Plugin WordPress
    Displaying questions of chosen categories
  2. Order displayed questions - use the orderby  parameter with voting or title value to order by voting or question title

    Example: 

    [cm_faq_all orderby="title"]

    Ordering displayed questions by titles - WordPress FAQ Plugin With Search Bar
    Ordering displayed questions by titles

    [cm_faq_all orderby="voting"]

    Ordering displayed questions by votes - FAQ Search WordPress Plugin
    Ordering displayed questions by votes
  3. Limit the number of displayed questions - use number=x . By default, there's no limit.

    [cm_faq_all number="10"]

    Displaying certain amount of questions - WP Responsive FAQ With Category Plugin
    Displaying certain amount of questions
  4. To enable or disable accordion view - use accordion attribute with 0 or 1 value to specify the accordion appearance of QA list items.

    If set active (1), it can overwrite general appearance settings and is configured via tab option Appearance > Accordion. You can choose separate icons for collapsed and expanded view and change the icon size.

    More information can be found here.

    [cm_faq_all accordion="0"]

    Disabling the accordion view - Q&A WordPress Plugin
    Disabling the accordion view

    [cm_faq_all accordion="1"]

    Enabling the accordion view - Frequently Asked Questions Plugin WordPress
    Enabling the accordion view

Example With All Parameters

[cm_faq_all category="Technology" orderby="title" number="3" accordion="1"]

Example with all parameters - WordPress FAQ Schema Plugin
Example with all parameters

Show Questions List From the Same Category

Note: this shortcode was introduced in version 1.8.0.

You can display the list of questions of the same category on the question page. It can be done using the shortcode[cm_faq_same_category_questions]

You can either add this shortcode to every question page, or to make it easier, you can place the shortcode as a widget to the sidebar. The list of related questions will be displayed only on the question pages. It will show only relevant questions from categories that the current question belongs to.

[cm_faq_same_category_questions]

Example of the shortcode added as a widget to the Sidebar - Accordion FAQ WordPress Plugin
Example of the shortcode added as a widget to the Sidebar
Result: the list of questions of the same category as the currently viewed question - WordPress Searchable FAQ Plugin
Result: the list of questions of the same category as the currently viewed question

Parameters

  • Order displayed questions - use the orderby  parameter to sort the questions by one of the following parameters:
    • date - order by question publish date (default).
    • voting - order by question voting.
    • title - order by question title.
    • modified - order by question modify date.
    • menu_order - order by Order field of question post.
    • rand - random order.

[cm_faq_same_category_questions orderby="title"]

Questions of the same category ordered by titles - WordPress Plugin for Expanding FAQ
Questions of the same category ordered by titles
  • Order direction - use the order  parameter to define the direction of sorting - either ascending (the value "asc") or descending (the value "desc"). The default order direction is ascending if used with orderby="title" , otherwise the default order direction is descending.

[cm_faq_same_category_questions orderby="title" order="desc"]

Questions of the same category ordered by titles in the descending order - WordPress FAQ Plugin
Questions of the same category ordered by titles in the descending order
  • Limit the number of displayed questions - use the number  parameter to limit the amount of displayed questions.

[cm_faq_same_category_questions orderby="rand" number="3"]

3 random questions of the same category - FAQ Plugin WordPress
3 random questions of the same category

TIP

The title above the questions list can be change in the Plugin Labels settings.

The question list title label - Best FAQ Plugin WordPress
The question list title label

More information about the WordPress FAQ 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.