Answer the question
In order to leave comments, you need to log in
Why are the products not found?
<?php
$args = array(
'post_type' => 'product',
'posts_per_page' => 16,
'category_name' => 'lestnitsy',
);
$loop = new WP_Query($args);
if ( $loop->have_posts() ) {
while ( $loop->have_posts() ) : $loop->the_post();
echo ' 1 ';
endwhile;
} else {
echo __( 'No products found' );
}
wp_reset_postdata();
?>
Answer the question
In order to leave comments, you need to log in
that's how it works
$args = array(
'post_type' => 'product',
'posts_per_page' => 16,
'tax_query' => array(
array(
'taxonomy' => 'product_cat',
'field' => 'id',
'terms' => 299
))
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question