WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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"]

share|improve this answer

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

share|improve this answer
    
Thanks for the answer, but i would rather solve it without the use of PHP code. I hope there is a way. – Sofus Albertsen Aug 9 '13 at 12:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.