custom types taxonomy hide_empty

I have a custom type, which uses custom taxonomy to create categories. I can add ‘products’ and assign them to the category structure that I have created.

There is a top level menu which displays the parent categories, clicking each takes the user into the category hierarchy.

Read More

If there are no products in any sub-category of a parent category, then that listitem shouldn’t display in the top level nav.

If I set hide_empty=1 all the parent categories disappear, not just the one with no products. Can anyone advise?

Related posts

Leave a Reply

1 comment

  1. Try setting ‘hierarchical’ to true if its not already.

    From source documentation:

    • hierarchical – Whether to include terms that have non-empty descendants
    • (even if ‘hide_empty’ is set to true).

    I think its usually set to trie by default, so I’m thinking you might have intentionally set it to fale for your purposes.