In this tutorial we’ll learn how to display products of a ctegory in template theme page. Fortunatley woocommerce comes with a number of shortcodes which could help us achieve this. Note that WooCommerce already creates category pages, but this shortcode is useful if you want to setup a special set of products without using the widgetized page template and widgets.
First of all we need to create a category. So i’ve created a new category named ‘category1′ having slug ‘category-1′.
Now i’m going to add some products to this category.
As you can see i’ve assigned some products to the newly created category.
Now we need to create a template theme page. To do this go to add new section under pages and add a new page. So, i’ve created a new page and named it test.
You can also change the page template here:
Now to show category1’s products to this page add the following short code into the page and hit create/update.
[product_category category="category-1"]
Replace the ‘category-1′ with your category slug.
Now go to front end and open the newly created page. Here you can see the product of category being displayed.