generate functionThu, 17 Nov 2022

get all products that have product_collection taxonomy

$args = array('post_type' => 'product', 'product_cat' => 'product-collection'); $loop = new WP_Query( $args ); if($loop->have_posts()) { while($loop->have_posts()) : $loop->the_post(); // do something endwhile; }

Questions about programming?Chat with your personal AI assistant