1

I have a small e-commerce site which is made by woocommerce. I want to display recent product in my home page and I could not able to do it so I have need Woocommerce recent post Meta key.

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
alibaba
  • 61
  • 5

3 Answers3

4

There is no meta_key for recent products, because it's based on date (i don't know which one exactly, you will have to look in your DB at wp_posts table).

But you can use recent products woocommerce shortcode on your homepage:

[recent_products per_page="12" columns="4"]

Or you can use Feature products shortcode:

[featured_products per_page="12" columns="4"]

Works the same as recent products but displays products that have been set as “featured.” If you use feature products, you could find this in DB.

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
2

if you want to show recent products on the home page you can use WooCommerce shortcode

per_page: how many products you want to show then page

column : columns attribute controls how many columns wide the products should be before wrapping.

 [recent_products per_page="12" columns="4"]
Deepti chipdey
  • 1,157
  • 9
  • 19
1

Lists recent products – useful on the homepage. The ‘per_page’ shortcode determines how many products to show on the page and the columns attribute controls how many columns wide the products should be before wrapping.

array(
    'per_page' => '12',
    'columns' => '4',
    'orderby' => 'date',
    'order' => 'desc'
)

[recent_products per_page="12" columns="4"]
mkj
  • 2,761
  • 5
  • 24
  • 28