WordPress
patterns/accordions-1-static.php
✔ Core
✔ Custom
- Use: a closing section at the very end of a page, before the footer, that gathers several questions or sections on one topic compactly; typically supplementary content written with search engines in mind.
- Not when everything must be visible at once, and not within the body of a page, which belongs in Accordions 2.
- Source: entered by hand in the editor.
- Content: an optional topic, a heading and an optional subline; 3 or more items, each a title and an answer of any length; one closing text link.
patterns/accordions-2-static.php
✔ Core
✔ Custom
- Use: several questions or sections on one topic within the body of a subpage, to keep it compact and easy to skim; content that matters to readers rather than search engines.
- Not as a closing section before the footer, which belongs in Accordions 1, and not for long titles.
- Source: entered by hand in the editor.
- Content: an optional topic, a heading and an optional subline; 3 to 7 items, each a title of one short line and an answer of any length.
Figma
Docs
Good to know
- Use a maximum of 7 accordions – otherwise the list becomes too long (bad ux)
- If WooCommerce or Yoast are in use, additional accordion blocks from those plugins are available.
- If schema.org data is required, this can be more easily achieved with the native accordionOpens in new tab (or the Yoast accordion).
Customizations in the custom theme
- The chevron has become the established icon and offers the best usability. We replace the default icon (+) with the chevron (expand, collapse) from our SVG sprite using a custom function.
- When an accordion is closed, its content cannot typically be found via the browser’s built-in search, as the native block unfortunately does not support
hidden=until-foundOpens in new tab. We have added this feature via JS in the custom build.
