How to insert an accordion into a knowledge base article
The accordion feature in WordPress allows you to create a number of tabs on a page that expand and present more information when clicked. The feature is used in FAQ articles, expanding with the answer to the question in the title tab.
To use the “accordion” feature in a knowledge base article, you must copy and paste the code.
- Place [[accordion] at the beginning of the code and [/accordion]] at the end of the code.
- To add an accordion tab, insert [[accordion-item title=”XXX”] with your tab title inside the quotations.
- Add an icon to the tab title by inserting Font Awesome HTML following icon= to the previous code. (Example: [accordion-item title=”This is a title?” icon=”fas fa-books”]).
- To add content in the tab, place text between [accordion-item title=”XXX”] and [/accordion-item]].
Here’s an example of code that generates the accordion below: [[accordion][accordion-item title=”This is a title?” icon=”fas fa-books”]Here is some Content.[/accordion-item][accordion-item title=”This is another title.”]Here is some more content![/accordion-item][/accordion]]
[accordion][accordion-item title=”This is a title?” icon=”fas fa-books”]Here is some Content.[/accordion-item] [accordion-item title=”This is another title.”]Here is some more content![/accordion-item][/accordion]
