Better code readability
$args = array(
‘post_type’ => ‘product’,
‘posts_per_page’ => 12,
‘tax_query’ => array(
array(
‘taxonomy’ => ‘get_vendor_products’,
‘field’ => ‘ID’,
‘terms’ => $sellers->ID
),
),
);
$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();
-
This reply was modified 5 years, 9 months ago by jontronics.