Title: Short-code specific top level categories only
Last modified: December 15, 2019

---

# Short-code specific top level categories only

 *  Resolved [hypevent](https://wordpress.org/support/users/hypevent/)
 * (@hypevent)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/short-code-specific-top-level-categories-only/)
 * I am familiar with this short-code `[product_categories number="0" parent="0"]`
   for top level categories but is there a way to use a similar short-code with 
   specific top level categories only?
 * The page is password protected: 4444
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fshort-code-specific-top-level-categories-only%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Support [Thu P. a11n](https://wordpress.org/support/users/thup90/)
 * (@thup90)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/short-code-specific-top-level-categories-only/#post-12241224)
 * Hi there,
 * You could use the [product_category] shortcode and specify the **ids** attribute.
   Here’s the documentation on that: [https://docs.woocommerce.com/document/woocommerce-shortcodes/#product-category-shortcodes](https://docs.woocommerce.com/document/woocommerce-shortcodes/#product-category-shortcodes)
 *  Thread Starter [hypevent](https://wordpress.org/support/users/hypevent/)
 * (@hypevent)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/short-code-specific-top-level-categories-only/#post-12244440)
 * Would you please give me an example of using IDS in a shortcade?
 *  Plugin Support [Thu P. a11n](https://wordpress.org/support/users/thup90/)
 * (@thup90)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/short-code-specific-top-level-categories-only/#post-12244975)
 * Hi there,
 * You could use the following:
 * [product_categories ids=”17″] (returns the category: [https://d.pr/i/2d22PC](https://d.pr/i/2d22PC))
 * or
 * [product_category category=”hoodies”] (returns the products in the category: 
   [https://d.pr/i/YjzvFO](https://d.pr/i/YjzvFO))
 * Hope this helps!
 *  Thread Starter [hypevent](https://wordpress.org/support/users/hypevent/)
 * (@hypevent)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/short-code-specific-top-level-categories-only/#post-12250822)
 * I tried [product_categories ids=”39, 26″] but it continues to show the categories
   in alphabetical order. I want to arrange the order of the categories shown.
 *  [linux4me2](https://wordpress.org/support/users/linux4me2/)
 * (@linux4me2)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/short-code-specific-top-level-categories-only/#post-12252120)
 * You can use the “orderby” attribute in the shortcode. According to the WooCommerce
   documentation:
 * >  The default is to order by “name”, can be set to “id”, “slug”, or “menu_order”.
   > If you want to order by the ids you specified then you can use orderby=”include”
 * The documentation for shortcodes can be found [here](https://docs.woocommerce.com/document/woocommerce-shortcodes/).
 *  [Luminus Alabi](https://wordpress.org/support/users/luminus/)
 * (@luminus)
 * Automattic Happiness Engineer
 * [6 years, 4 months ago](https://wordpress.org/support/topic/short-code-specific-top-level-categories-only/#post-12255572)
 * Hi [@hypevent](https://wordpress.org/support/users/hypevent/),
 * A [@linux4me2](https://wordpress.org/support/users/linux4me2/) mentioned, the`
   orderby` attribute is your friend here.
 * You can see the possible options for that attribute in the documentation here–
   [https://docs.woocommerce.com/document/woocommerce-shortcodes/#product-category-attributes](https://docs.woocommerce.com/document/woocommerce-shortcodes/#product-category-attributes).
 *  Thread Starter [hypevent](https://wordpress.org/support/users/hypevent/)
 * (@hypevent)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/short-code-specific-top-level-categories-only/#post-12255954)
 * Thank you all for your assistance and patience with a relative newbie to WooCommerce.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Short-code specific top level categories only’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 7 replies
 * 4 participants
 * Last reply from: [hypevent](https://wordpress.org/support/users/hypevent/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/short-code-specific-top-level-categories-only/#post-12255954)
 * Status: resolved