[faq_element]
This is the main shortcode for displaying the frequently asked questions (FAQ) listing section on a page.
Product
Shortcode Attributes
There are a number of shortcode attributes available which you can use to customize the output.
GENERAL LAYOUT
- listing_only – Enables or disables displaying only the list of questions without the accordion.
- Default:
off. - Options:
on,off. Specify one only.
- Default:
- display – Defines the FAQ display layout.
- Default:
image-above-content. - Options:
- ORDINARY DISPLAYS:
image-above-content,image-overlay-content,content-only. Specify one only. - SPLIT DISPLAYS:
image-left-content,image-right-content. Specify 2 (Split and Split Size). Use commas to separate. - SPLIT DISPLAY SIZES (Required on Split Display):
split-25-75,split-40-60,split-50-50,split-60-40. Specify 3(Split, Split Size, and Alternate Split). Use commas to separate. - ALTERNATE SPLIT DISPLAY (Can use only on Split-50-50 and on the opposite option of the Split Display):
then-left,then-right.
- ORDINARY DISPLAYS:
- Default:
- first_item_open – Determines whether the first accordion item is open by default.
- Default:
off. - Options:
on,off. Specify one only.
- Default:
- all_closed – Determines whether all accordion items are closed by default.
- Default:
off. - Options:
on,off. Specify one only.
- Default:
- multiple_expand – Allows multiple accordion items to be open simultaneously.
- Default:
off. - Options:
on,off. Specify one only.
- Default:
- deep_link – Enables deep linking support for accordion items.
- Default:
off. - Options:
on,off. Specify one only.
- Default:
DESIGN
- element_width – Defines the width of the element.
- Default:
default-width. - Options:
default-width,full-width. Specify one only.
- Default:
- alignment – Defines the alignment of the element.
- Default:
default-alignment. - Options:
default-alignment,left,center,right. Specify one only.
- Default:
- theme – Defines the styling theme for the element.
- Default:
default-section - Options:
default-section,light,dark. Specify one only.
- Default:
- background – Background image or color for the element.
- Options: Any image URL.
- classes – Additional CSS classes for the element.
- id – Unique identifier for the element.
- Options: Any text value.
HEADER
- heading – Element heading.
- Options: Any text value.
- heading_size – Heading size.
- Default:
h2. - Options:
h1,h2. Specify one only.
- Default:
- sub_heading – Element subheading.
- Options: Any text value.
CONTENT
- group_by_category – Groups questions by category.
- Default:
off - Options:
on,off. Specify one only.
- Default:
- image – Image for the element. Used to add image content for image-left-accordion or image-right-accordion layout.
- Options: Any image URL.
- orderby – Defines the sorting order for questions.
- Default:
id. - Options:
id,date,title,modified. Specify one only.
- Default:
- order – Defines the sorting direction.
- Default:
ASC. - Options:
ASC,DESC. Specify one only.
- Default:
FILTER
- categories – FAQ Category IDs.
- Options: Any numeric value. Use commas to separate.
- tags – FAQ Tag IDs.
- Options: Any numeric value. Use commas to separate.
Example Usage
[faq_element
first_item_open="on"
multiple_expand="on"
deep_link="on"
heading="Frequently Asked Questions"
heading_size="h2"
sub_heading="Answers to Popular Questions"
group_by_category="on"
orderby="date"
order="DESC"
]
| Example: This shortcode will display a FAQ section with the following features: – The first question is expanded by default. – Users can expand multiple questions at the same time. – Each question has a unique URL for deep linking. – The FAQ items are grouped by their categories. – The questions are sorted by date, with the newest ones appearing first. – The section has a main heading ( <h2>Frequently Asked Questions</h2>) and a subheading (Answers to Popular Questions). |
faq post type must exist in the system.The
categories and tags parameters allow filtering questions by specified categories and tags.