Linux 软件免费装
Banner图

Accordion Block Lite

开发者 troytempleman
更新时间 2024年4月3日 08:30
捐献地址: 去捐款
PHP版本: 7.4 及以上
WordPress版本: 6.4.1
版权: GPLv2 or later
版权网址: 版权信息

标签

responsive block accessible accordion collapse expand hide show sections accordion item

下载

0.1.0

详情介绍:

Accordion Block Lite 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. Ideal for condensing longform or complex content, such as Frequently Asked Questions (FAQ). Also useful for reducing page scrolling. Features Demo https://troytempleman.com/wordpress/blocks/accordion-block/ HTML Accordion Block Lite will output an Accordion block with the following HTML structure:

安装:

Accordion Block Lite can be installed in one of the following four ways: Automatic To install with the built-in plugin installer:
  1. Login to your WordPress site at domain.com/wp-admin, where domain.com is the domain of your WordPress site.
  2. On the Dashboard page, in the left menu, click Plugins.
  3. On the Plugins page, click Add New Plugin.
  4. On the Add Plugins page, in the Search plugins... field, type Accordion Block Lite.
  5. In the Search Results, locate Accordion Block Lite, click Install Now and Activate.
Upload To install with a .zip file:
  1. Login to your WordPress site at domain.com/wp-admin, where domain.com is the domain of your WordPress site.
  2. On the Dashboard page, in the left menu, click Plugins.
  3. On the Plugins page, click Add New Plugin.
  4. On the Add Plugins page, click Upload Plugin.
  5. Click Choose File, locate the .zip file and click Open.
  6. Click Install Now.
  7. On the Installing Plugin from uploaded file page, click Activate.
Manual To install with a SFTP client:
  1. If you have a .zip file, unzip it with archiving software such as WinZip or Archive Utility.
  2. In a SFTP client such as WinSCP or FileZilla, connect to your WordPress site directory on your server.
  3. In the unzipped files, copy the accordion-block-lite folder and paste on your server, in your site’s wp-content/plugins folder.
  4. Login to your WordPress site at domain.com/wp-admin, where domain.com is the domain of your WordPress site.
  5. On the Dashboard page, in the left menu, click Plugins.
  6. On the Plugins page, locate Accordion Block Lite and click Activate.
Theme To install in your theme instead of a plugin:
  1. If you have a .zip file, unzip it with archiving software such as WinZip or Archive Utility.
  2. In the unzipped files, copy the accordion-block-lite folder and paste in your site’s theme folder, such as wp-content/themes/your-theme/inc/accordion-block-lite/, where your-theme is your theme folder.
  3. In a code editor such as Visual Studio Code or Notepad++, open your theme's functions.php file.
  4. In your functions.php file, add the path from Step 2, such as require get_stylesheet_directory() . '/inc/accordion-block-lite/accordion-block-lite.php';.
  5. Save and close your functions.php file.

屏幕截图:

  • Accordion block variations **[Pro]**.
  • Accordion block settings sidebar. **[Pro]**.
  • Accordion block settings sidebar **[Pro]**.
  • Accordion block on the front end.

常见问题:

What is an accordion?

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).

How do I install Accordion Block Lite?

Please see Installation section.

How do I add an Accordion block?

  1. Login to your WordPress site at domain.com/wp-admin, where domain.com is the domain of your WordPress site.
  2. On the Dashboard page, in the left menu, click Posts or Pages.
  3. On the Posts or Pages page, either click Add New, search for and/or click the desired post or page title.
  4. In the block editor, either:
  5. Click the block inserter + icon in the top toolbar
  6. Click the block inserter + icon to the right of an empty block, or
  7. Click the block inserter + icon between blocks
  8. In the block inserter pop-up modal window, search for and/or click Accordion to add an Accordion block.

How do I edit an Accordion block?

  1. Login to your WordPress site at domain.com/wp-admin, where domain.com is the domain of your WordPress site.
  2. On the Dashboard page, in the left menu, click Posts or Pages.
  3. On the Posts or Pages page, search for and/or click the desired post or page title.
  4. In the block editor, click the desired Accordion block.
  5. To edit the whole Accordion block:
  6. In the block toolbar above, click the Accordion icon, select the desired position, block alignment, text formatting and/or other options.
  7. In the settings sidebar, in the Block tab:
  8. In the Settings tab, select the desired Header Element, Header Icon and/or Header Icon Position settings.
  9. In the Styles tab, select the desired Color, Typography, Dimensions and/or Border settings.
  10. To edit an Accordion Item within the Accordion block:
  11. Click the desired Accordion Item title and/or panel to edit.
  12. In the block toolbar above, select the desired position, text alignment, text formatting and/or other options.
  13. In the settings sidebar, in the Block tab, select the desired Color, Typography, Dimensions and/or Advanced settings.
  14. To add an Accordion Item, click the + button below the Accordion block.

How do I setup a development environment?

  1. Install WordPress on a local server such as Local, Docker, MAMP or XAMPP.
  2. To install Accordion Block Lite on your local site, see Installation section.
  3. If node.js is not already installed locally, go to https://nodejs.org/ to install.
  4. In a Command Line Interface (CLI) such as Command Prompt or Terminal, navigate to the accordion-block-lite folder. For example, cd localhost/your-site/wp-content/plugins/accordion-block-lite.
  5. To install project dependencies, type npm install.
  6. In the accordion-block-lite folder, edit the desired file or files.
  7. To create or update the production build directory, type npm run build. For other commands, type npm run.

更新日志:

0.1.0 - November 15, 2023