Contributors: Said Erraoudy
Tags: accordion, accordion item, block, expand, collapse, show, hide, sections, accessible, responsive
Requires at least: 6.1
Version: 0.1.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
A block that displays list items that expand and collapse to show and hide their associated sections of content.
BB Accordion Block adds an accessible and responsive Accordion block to the block editor inserter that can be added to display list items that expand and collapse to show and hide their associated sections of content.
- Accessible
- Responsive
- Inserter button for adding accordion items
- Settings
- Block alignment
- Text alignment
- Text formatting
- Header element
- Styles
- Color
- Text
- Background
- Link
- Typography
- Font family
- Font size
- Appearance
- Line height
- Letter spacing
- Text decoration
- Letter case
- Dimensions
- Padding
- Margin
- Color
- WordPress 6.1 or greater
- PHP version 7.4 or greater
- MySQL version 5.7 or greater or MariaDB version 10.3 or greater.
BB Accordion Block can be installed in one of the following four ways:
To install with a .zip file:
- Login to your WordPress site at domain.com/wp-admin, where domain.com is the domain of your WordPress site.
- On the Dashboard page, in the left menu, click Plugins.
- On the Plugins page, click Add New Plugin.
- On the Add Plugins page, click Upload Plugin.
- Click Choose File, locate the .zip file and click Open.
- Click Install Now.
- On the Installing Plugin from uploaded file page, click Activate.
To install with a SFTP client:
- If you have a .zip file, unzip it with archiving software such as WinZip or Archive Utility.
- In a SFTP client such as WinSCP or FileZilla, connect to your WordPress site directory on your server.
- In the unzipped files, copy the BB-accordion-block folder and paste on your server, in your site’s wp-content/plugins folder.
- Login to your WordPress site at domain.com/wp-admin, where domain.com is the domain of your WordPress site.
- On the Dashboard page, in the left menu, click Plugins.
- On the Plugins page, locate BB Accordion Block and click Activate.
To install in your theme instead of a plugin:
- If you have a .zip file, unzip it with archiving software such as WinZip or Archive Utility.
- In the unzipped files, copy the BB-accordion-block folder and paste in your site’s theme folder, such as wp-content/themes/your-theme/inc/BB-accordion-block/, where your-theme is your theme folder.
- In a code editor such as Visual Studio Code or Notepad++, open your theme's functions.php file.
- In your functions.php file, add the path from Step 2, such as require get_stylesheet_directory() . '/inc/BB-accordion-block/bb-accordion-block.php';.
- Save and close your functions.php file.
An accordion is a common UI/UX pattern that can help reduce or condense the amount of information presented to users.
It is a vertically stacked set of interactive headings that each contain a title, content snippet, or thumbnail representing a section of content. The headings function as controls that enable users to reveal or hide their associated sections of content. Accordions are commonly used to reduce the need to scroll when presenting multiple sections of content on a single page.
The term stems from the musical accordion in which sections of the bellows can be expanded by pulling outward.
To learn more, see Accordion (Sections With Show/Hide Functionality).
Please see Installation section.
- Login to your WordPress site at domain.com/wp-admin, where domain.com is the domain of your WordPress site.
- On the Dashboard page, in the left menu, click Posts or Pages.
- On the Posts or Pages page, either click Add New, search for and/or click the desired post or page title.
- In the block editor, either:
- Click the block inserter + icon in the top toolbar
- Click the block inserter + icon to the right of an empty block, or
- Click the block inserter + icon between blocks
- In the block inserter pop-up modal window, search for and/or click Accordion to add an Accordion block.
- Login to your WordPress site at domain.com/wp-admin, where domain.com is the domain of your WordPress site.
- On the Dashboard page, in the left menu, click Posts or Pages.
- On the Posts or Pages page, search for and/or click the desired post or page title.
- In the block editor, click the desired Accordion block.
- To edit the whole Accordion block:
- In the block toolbar above, click the Accordion icon, block alignment, text formatting and/or other options.
- In the settings sidebar, in the Block tab:
- In the Settings tab, select the desired Header Element, settings.
- In the Styles tab, select the desired Color, Typography, Dimensions settings.
- To edit an Accordion Item within the Accordion block:
- Click the desired Accordion Item title and/or panel to edit.
- In the block toolbar above, text alignment, text formatting and/or other options.
- In the settings sidebar, in the Block tab, select the desired Color, Typography, Dimensions and/or Advanced settings.
- To add an Accordion Item, click the + button below the Accordion block.
- Install WordPress on a local server such as Local, Docker, MAMP or XAMPP.
- To install BB Accordion Block on your local site, see Installation section.
- If node.js is not already installed locally, go to https://nodejs.org/ to install.
- In a Command Line Interface (CLI) such as Command Prompt or Terminal, navigate to the BB-accordion-block folder. For example, cd localhost/your-site/wp-content/plugins/BB-accordion-block.
- To install project dependencies, type npm install.
- In the BB-accordion-block folder, edit the desired file or files.
- To create or update the production build directory, type npm run build. For other commands, type npm run.
- Initial release