Website Building » WooCommerce » How Do I Display a Specific Category Product in WooCommerce?

How Do I Display a Specific Category Product in WooCommerce?

Last updated on January 19, 2023 @ 6:03 pm

There are a few different ways that you can display a specific category product in WooCommerce. One way is to use the built-in WooCommerce product categories widget. This widget will display a list of all the products in a specific category. Another way is to use the [product_category] shortcode.

This shortcode will display a list of all the products in a specific category. You can also use the [product_categories] shortcode to display a list of all the products in all the categories.

If you want to display a specific category product on your WooCommerce shop page, you can use the following code:

[product_category category=""]

Replace “” with the slug of the desired product category. For example, if you want to display products from the “Shoes” category, you would use this code:

[product_category category="shoes"]

If you want to display a specific category product on your WooCommerce single product page, you can use the following code:

[product_categories number=""]
PRO TIP: If you are using a WooCommerce plugin and want to display a specific category product, be sure to first check the plugin’s documentation. Many plugins have specific instructions on how to do this. Additionally, be aware that some plugins may not work with all themes, so you may need to check with the theme developer to see if the plugin is compatible.

Replace “” with the number of products you want to display from that category. For example, if you want to display 10 products from the “Shoes” category, you would use this code:

[product_categories 
    number="10" 
    columns="4" 
    orderby="date" 
    order="desc"
]  

The [product_categories] shortcode displays a list of all the products in all categories. If you want to display a specific number of products from all categories, you can use the number attribute. For example, if you want to display 10 products from all categories, you would use this code:

[product_categories 
    number="10" 
    columns="4" 
    orderby="date" 
    order="desc"
]  

[product_category]

The [product_category] shortcode displays a list of all the products in a specific category. If you want todisplay a specific category product on your WooCommerce shop page, you can use this code:

[product_category 
    id="" 
    title="" 
    orderby="" 
    order="" 
    parent="" description=""
    image="" class="" style=""
]   

Attributes

  • id(string) : The ID of the desired product category.
  • title(string) : The title of desired product category.
  • orderby(string) : The order by parameter for retrieving products.
  • order(string) : The order parameter for retrieving products.
  • parent(integer) : The parent parameter for retrieving products.
  • description(boolean or string): Whether or not to retrieve the description for the desired product category.
Drew Clemente

Drew Clemente

Devops & Sysadmin engineer. I basically build infrastructure online.