How to add products by category using shortcode woocommerce?

After trying a lot of methods for adding products by category using shortcode, i finally found one that worked perfectly for me. You just have to add this in the text editor or anywhere, where you want to show products with the help of shortcode and also for a specific category.

Code:

[[[product_category category="YOUR-CATEGORY-SLUG-HERE" per_page="12" columns="4" orderby="date" order="desc"]]]

So, you will copy this code from here and will paste it to your desired location with your category slug that can be found by navigating to the product menu in your WP admin and clicking on categories where you’ll see a list of all available categories and corresponding slugs.

Where I was needed this code? See below and you will understand

Hope you understand 🙂

Source: https://stackoverflow.com/questions/31018148/shortcode-to-show-products-by-category-woocommerce

Please let me know in comments if you find a better way to do the same task. I’ll be thankfull to you.

Enjoy 🙂

Share it in your network:

Leave a Comment

Your email address will not be published.

small_c_popup.png

Congratulations!

You have successfully subscribed to my email list. Now you will be recieving latest wordpress tips and tricks directly in your mail box.

Don’t worry! I won’t spam you