Hello I have a page template I use for my home page, The website is a Wordpress website with a Woocommerce store.
I show featured products using this snippet of code and it works well within my layout and grid.
<div class="woocommerce columns-4 ">
<ul class="products">
<?php
$args = array(
'post_type' => 'product',
'posts_per_page' => 25,
'tax_query' => array(
array(
'taxonomy' => 'product_visibility',
'field' => 'name',
'terms' => 'featured',
),
),
);
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) {
while ( $loop->have_posts() ) : $loop->the_post();
wc_get_template_part( 'content', 'product' );
endwhile;
} else {
echo __( 'No products found' );
}
wp_reset_postdata();
?>
</ul><!--/.products-->
</div>
I wana duplicate this section and instead of the 'terms' => 'featured'
I would like it to be 'terms' => 'recent_products'
However, are these terms like hooks? What would be the proper changes to pull in recent products instead of the featured ones?
Thanks!