Gutenberg Block

Adding the Block

  1. Open any page or post in the WordPress block editor.
  2. Click the + inserter icon or type /woocommerce category in an empty block.
  3. Select WooCommerce Category Accordion from the results.

The block renders a live preview in the editor. The preview uses your saved global settings as defaults and updates as you adjust block settings.

Block Settings Panel

With the block selected, open the Block tab in the right-hand sidebar to access these controls:

Setting Description
Theme Override the global theme for this specific block instance.
Icon Style Override the global icon style.
Order By Sort categories by Name, ID, Slug, or Custom Order.
Order ASC or DESC.
Show Count Show the product count badge per category.
Hide Empty Hide categories with no published products.
Max Depth Limit nesting depth. 0 = unlimited.
AJAX Loading Enable AJAX lazy loading for this block instance.
Event Type Click or Hover to expand.

Editor Preview vs Front-End

The editor preview renders the full accordion tree and is interactive — you can click categories to test the expand/collapse behaviour. The front-end output is identical. CSS custom properties are applied, so custom styles you’ve added to your theme also apply inside the editor.

Multiple Blocks on One Page

You can place multiple WCA blocks on the same page with different settings. Each block instance is fully independent — different themes, different sort orders, different depths.

Shortcode
[WC-Category-Accordion]

Frequently Asked Questions