Accordion / Content Toggle
Content Toggle (Accordion) – There is a new blocks plugin called ‘Ultimate Blacks’ available for use for creating content toggles (accordions). Official documentation.
You must have the new WordPress block editor enabled on the page (not the Classic Editor). Add a block and search for “Content Toggle”
From the right column in the editor, set the block to use
- Show only one panel at a time
- Collapsed
Demo 1
This is some text.
Demo 2
This is some text.
Demo 3
This is some text.
Linking to an accordion item from another page
You can link directly to an accordion item from another page.
When you add the link, you will need to add to the end the ‘#’ character followed by the title of the accordion item (all lowercase, replacing any spaces with dashes ‘-‘. For example, to link to the ‘Demo 2’ item above, the link would look like this:
https://ourtrust.org/internal/accordions/#demo-2
Shortcodes documentation *
*the accordion shortcodes will be phased out as the new Content Toggle block is implemented throughout the site.
- Official documentation – Accordion Shortcodes Documentation. (Includes documentation of advanced features like controlling which accordion section is open when a user arrives at a page, or linking directly to a specific accordion section based on a parameter in the URL.).
Accordion Shortcodes notes
Use Accordions for FAQs and other sections of the site that require several similar content items to collapse and expand. Accordions are typically used with 4 or more section of text. Examples: Board Member Bios, Youth FAQ.
Tip: To use the codes on your own pages, select Edit and switch into the Text view tab to copy the shortcodes. Once you have pasted the shortcodes into your page in Text view, you can edit them as needed.