Setup
Shop page with a product query loop (post type: product) and a
Filter – [Radio / Checkbox] element targeting that loop.
Filter source: Taxonomy → Product categories
Option “Top level terms only” enabled.
Category structure:
Audio (0 products directly assigned)
├─ Headphones (12 products)
└─ Cables (3 products)
Products are assigned to the child terms only, never to the parent term.
Steps to reproduce
- Create a parent product category with two child categories.
- Assign products to the child terms only, none to the parent.
- Add a product query loop and a Filter – [Radio] element targeting it,
source = product categories, limited to top-level terms. - Regenerate the filter index.
- Open the page on the frontend.
Expected
“Audio” is selectable and returns 15 products (12 + 3), because a tax_query
on a hierarchical taxonomy includes child terms by default
(include_children = true).
Actual
“Audio” is rendered as disabled and cannot be selected. It is treated as if
it had 0 matching results.
Why this looks like a bug rather than a config issue
Calling the filter URL parameter manually works exactly as expected:
/shop/?_category=audio → all 15 products are returned.
So the query side already resolves child terms correctly. Only the option
state in the filter UI is wrong.