...

WooCommerce: How To Display Product Categories on Any Page

Shop Categories

Categorizing products is a great a way to de-clutter your WooCommerce shop and intuitively guide users to the page they are looking for. In WooCommerce you can easily group your similar products under a category, making it easy for users to scan and find the products.

For Example, if you sell T-shirts, Shirts, Pants, and Sunglasses you can easily categorize T-shirts, Shirts, and Pants under “Clothing” category and Sunglasses under “Accessories”.

In WooCommerce shop or archive pages you can display only products, only categories or both products and categories together. In this article we will see how to create WooCommerce categories and display them on shop or archive pages.

Displaying WooCommerce Product Categories

Show Product Categories on Homepage

If your theme is WooCommerce compatible and has a homepage template that has WooCommerce sections, then you will be able to display product categories on Homepage. Otherwise you will have to display product categories using WooCommerce category shortcodes.

Show Product Categories on any Page

You can display product categories on any page using the following shortcodes supplied with WooCommerce.

  • [ product_category ] – Display all the products of a certain category
  • [ product_categories ] – Display all product categories

Let’s see how to display WooCommerce product categories on a page.

  1. Go to Dashboard -> Pages and select any page
  2. Write the shortcode [ product_categories ] to display all categories
  3. If you want to more control, you can use below parameters to modify what you want to display.example:[ product_categories parent="0" ]
  4. Click on Publish after making the changes.

Product Category Shortcode parameters:

ParameterAccepted ValueDescription
number12Number of categories you want to display
orderbyID | title | nameOrder the product by
orderASC, DESCDetermines the order of the categories, whether ascending or descending.
columns3Number of columns
hide_empty0 | 11 to hide category which don’t have any products listed under them.
parent0 | 10 to display only the parent categories and 1 to display all categories (with sub-categories)
ids12comma separated list of category IDs

Link to the Full Article

1 thought on “WooCommerce: How To Display Product Categories on Any Page”

  1. Your blog is a treasure trove of valuable insights and thought-provoking commentary. Your dedication to your craft is evident in every word you write. Keep up the fantastic work!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
Seraphinite AcceleratorOptimized by Seraphinite Accelerator
Turns on site high speed to be attractive for people and search engines.