How to Show Recent WooCommerce Products on Home Page

This entry is part 1 of 4 in the series WooCommerce Development

This article is about The most popular CMS wordpress and its Most Famous Plugin WooCommerce. I love WooComerce and WordPress, and I will talk a lot on these, there will be more how to’s but, I will majorly focus on achieving things in WordPress and WooCommerce using Code, I like to avoid plugins and do it myself. That is how you can build your knowledge around wordpress. The world of wordpress is huge and from a developer perspective it may take more than a year to fully understand the wordpress.

Today we will learn How to Display Recent WooCommerce Producs on your Home Page or any page for that matter. We will use the famous wordpress loop. I’ve also created a nice looking card to hold woocommerce product information. I dont prefer the traditional appearance of woo products.

Our Final code will show the page like below :

 

 
We will loop through the 4 most recent woo products. Clicking on the product will take you to the Product page, If you click on “Add To Cart” it will take you to the Cart Page with the product added to Cart.

We are going to use below functions :

Paste the Below code into your page-template but, make sure you have 3-4 woocommerce products already created with thumbnail, title and price. If you dont have price set for a product it will show you “Read More” button instead of “Add To Cart” button.

Please let me know if you have any questions for above code in comments below.

Series NavigationHow to Add Author to WooCommerce Product- Part 1 >>