Displaying Woocommerce categories and products on an existing web page can be very useful, especially if you have good page rank for existing content.
One of our clients wanted to sell memberships through their website. They had an existing WordPress website that we had recently installed Woocommerce on. They don’t have a lot of products, but they do have a lot of content and so we have started to add opportunities for visitors to buy products into associated pages that already receive lots of visits.
Displaying Woocommerce Categories on existing page
I first thought about making a Woocommerce custom category page template and then assigning the page with my content on that particular template.
But I soon thought, “Hey, this is Woocommerce, there must be an easier way. Surely there must be some shortcode for adding Woocommerce categories to existing pages”.
Well there is! And this is the category shortcode you can use:
[product_category category="slug" per_page="12" columns="4" orderby="price" order="asc"]
Important things to note are the “category slug”, which you use to specify which category you wish to display. The other options allow you some flexibility: number of items to show and their layout.
- Find the page on your website where you want the Woocommerce category to display and go to edit it.
- Switch your WYSIWG editor to the “Text” mode.
- Write your shortcode in the place where you want your Woocommerce categories to display, e.g. above or below your content.
- Modify the shortcode to suit your needs, e.g. number of items per page, order by price, etc.
If you need any help, just contact us.