WooCommerce Single Product Page Show All Categories

WooCommerce Single Product Page Show All CategoriesDo you want to show all categories on the WooCommerce single product page? You have come to the right place. In today’s post, we will share how you can achieve this on your WooCommerce website.

It is important to categorize products in your store. This is because it helps to de-clutter your WooCommerce store.

Categorizing also helps to guide users to the page or product they want. Customers can easily scan and find the products they are searching for.

For example, if you sell different types of cars, you can categorize them according to their brands.

However, it is important to add product categories first in WooCommerce. Let us get right into it.

How to Add Product Categories in WooCommerce

As you will quickly find out, it is not a complicated process to add product categories in WooCommerce. Here are the steps you need to follow:

  1. Log in to your site as admin.
  2. Navigate to Dashboard > Products > Categories
  3. On the left side, you will see different fields that you need to fill. They are Name, Slug, Parent, Description, Display type, and Thumbnail.
  • Name: Your product category name
  • Slug: determines the URL
  • Parent: If this category is the parent category or does it falls under another category
  • Description: Detailed category info
  • Display Type: Determines when visitors land on the category page what (products, subcategories, or both) they will see
  • Thumbnail: Image of the product category

product cats

  1. Once you are done filling in all the category information, click on Add New Product Category button.

Show Product Categories on any Page

After creating all the categories you need, you can display them on any page using shortcodes. Shortcodes are small pieces of code, indicated by brackets like [this]. They are used to perform a dedicated function on your site.

It is important to note that they add a specific feature to your page, post, or other content. In this section, we will use the following shortcodes:

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

Here are the steps you need to follow:

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

Here are the Product Category Shortcode parameters:

Parameter Accepted Value Description
number 12 The number of categories to be displayed
orderby ID | title | name Order product by
order ASC, DESC Order the categories whether ascending or descending.
columns 3 Columns to be displayed
hide_empty 0 | 1 1 to hide categories that don’t have any products
parent 0 | 1 0 to display only the parent categories and 1 to display all categories
ids 12 Comma-separated list of category IDs

It is important to note that you can use the parameters to display the categories you need on the single product page.

Conclusion

In summary, we have shared how you can display categories in WooCommerce. We have also shared 2 different shortcodes with parameters to display categories on any page like the single product page.

If you need to customize your categories further, we recommend contacting a qualified WordPress developer. This is important if you are not familiar with making changes in WooCommerce.

Similar Articles

  1. How to Add WooCommerce Products to a Page