Shortcodes: Content Accordions - AgriLife/AgriFlex GitHub Wiki

This content accordion offers a pretty flexible solution for embedding multiple accordions within content areas. By allowing you to set multiple groups and insert accordions belonging to the same group in different parts of the content.

Usage:

Simply surround whatever content you wish to include within the accordion with the shortcode:

[accordion]your content here[/accordion]

and the plugin will do the rest.

Accordion Title

By default a link with the text “Expand Content” is added above the hidden content to expand/collapse it. To change this text add a title attribute to the shortcode like such

[accordion title=“Your Title Here” ]your content here[/accordion]

Groups

Accordions can be grouped together by specifying a unique group name or number. By default all accordions are given a group that links all accordions of the same post or page together. So clicking on one should collapse the only open accordion content area of that page or post. To assign your own group to an accordion add a group attribute and assign it something unique you will use with the others in the group.

[accordion title="I belong to group 1" group="group-1"]your content here[/accordion]

[accordion title="I'm special" group="special"]your content here[/accordion]

[accordion title="I belong to group 1 as well" group="group-1"]your content here[/accordion]

[accordion title="Your Title Here" ]your content here[/accordion]

The only two accordions that will be linked together are group–1, all others will independently unless more accordions are added without a group. In which case the last accordion listed would link with them.