WooCommerce [product_categories] shortcode - Missing displayed sub-categories WooCommerce [product_categories] shortcode - Missing displayed sub-categories wordpress wordpress

WooCommerce [product_categories] shortcode - Missing displayed sub-categories


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


You need to assign product to categories, after that all categories will be display.


To show sub categories of category you have to change "parent" attrribute. below are some other fields for shortcode.

array(      'number' => 'null',      'orderby' => 'title',      'order' => 'ASC',      'hide_empty' => '1',      'parent' => '',      'ids' => '' )[product_categories number="" orderby="" order"" hide_empty="" parent="0" ids""]

The "number" field is used to display the number of products categories.
The "orderby" field is used to display the order of products categories.
The "order" field is used to display the order( ASC / DESC ) of products categories.
The "hide_empty" field is used to hide products category not assigned to any product.
The "parent" parameter to 0 to only display top level categories.
The "ids" field is to tell the shortcode which categories to display.

For more info see this link