Есть такой код
<div class="azera_shop_products_container">
<?php
if ( $cat == 'all' ) {
$args = array( 'post_type' => 'product', 'stock' => 1, 'posts_per_page' => $nb_of_products, 'orderby' => 'date','order' => 'DESC' );
} else {
$args = array( 'post_type' => 'product', 'stock' => 1, 'posts_per_page' => $nb_of_products, 'orderby' => 'date','order' => 'DESC', 'product_cat' => $cat );
}
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>
<div class="col-md-4 col-sm-6 home-shop-product-wrap-all">
<div class="home-shop-product-wrap">
<div class="home-shop-product-img">
<?php
if ( has_post_thumbnail( $loop->post->ID ) ) {
echo get_the_post_thumbnail( $loop->post->ID,'azera_shop_home_prod' );
} else { echo '<img src="' . woocommerce_placeholder_img_src() . '" alt="Placeholder" />';
}
?>
</div>
<p class="home-shop-product-price">
<?php echo $product->get_price_html(); ?>
</p>
<div class="home-shop-product-info">
<a id="id-<?php the_id(); ?>" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<div class="home-shop-product-title">
<h3><?php the_title(); ?></h3>
</div>
</a>
<div class="home-shop-product-content">
<?php the_excerpt(); ?>
</div>
<div class="home-add-to-cart-wrap">
<?php woocommerce_template_loop_add_to_cart( $loop->post, $product ); ?>
</div>
</div>
</div>
</div>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
</div>
Не могу понять что тут нужно изменить чтобы вывести товары определенной категории?