Is there a way to add a shortcode to a page, in order for that to display the subcategories of a category? (not the products themselves)
I know that you can configure Woocommerce to display it, but I need to have it on a page, so that I can hide it via UAM plugin.
I am aware of the shortcode:
[product_categories number="12" parent="0"]
But that displays only the top categories. I need the child categories of one top category.
Is there a way to add a shortcode to a page, in order for that to display the subcategories of a category? (not the products themselves)
I know that you can configure Woocommerce to display it, but I need to have it on a page, so that I can hide it via UAM plugin.
I am aware of the shortcode:
[product_categories number="12" parent="0"]
But that displays only the top categories. I need the child categories of one top category.
That's easy. Just use the same shortcode and in the parent attribute, place the ID of the parent category. You'll get out its sub-categories as a result:
[product_categories number="12" parent="57"]
You could easily display the category widget from WooCommerce in a page template using :
the_widget('WC_Widget_Product_Categories');
The code with parameters can be find in woocommerce\classes\widgets\class-wc-widget-product-categories.php