WooCommerce [product_categories] shortcode - Missing displayed sub-categories

Patzu picture Patzu · Aug 8, 2016 · Viewed 9.4k times · Source

I am using WooCommerce plugin in WordPress, and I have added 20 sub-categories in one parent category. When I want to display all the sub-categories in a page using this shortcode:

[product_categories number="20" parent="0"]

It just retrieves 12 of them with no pagination and doesn't display sub-categories.

Why this is happening?
How can I increase this limit?

Answer

LoicTheAztec picture LoicTheAztec · Aug 8, 2016

In [product categories] WooCommerce shortcode, the argument number is used to display the number of products in that categories / subcategories and not the number of categories.

And argument parent="0" will only display top level categories and not subcategories.

This shortcode is made to display product categories loop

Reference: [product categories] WooCommerce shortcode