Skip to content
Advertisement

Display sub subcategories terms list on WooCommerce subcategory archive pages

In Woocommerce I use Get the subcategories of the current product category in Woocommerce archives answer function, to display a list of subcategories on the parent category pages

But I only need to apply this to SPECIFIC product-categories though, and to use array with a hunch of category IDs seems not ideal.

I need to display the list only on the first children categories, so for example one of my main parent categories is “Clothing”, then the subcategory “Shirts” and then the sub-sub-category “Sleeveless”. I only need to display it on the first sub-categories, in this example “Shirts”.

Advertisement

Answer

To display only the first subcategory on main category archive pages only use:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement