WordPress
946
Вклад в тег
$thumb_ID = get_woocommerce_term_meta( $cat->term_id, 'thumbnail_id', true );
<ul class="products">
<?php
$product_ids_on_sale = wc_get_product_ids_on_sale();
$args = array(
'post_type' => 'product',
'post__in' => array_merge( array( 0 ), $product_ids_on_sale )
);
$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 __( 'Продуктов не найдено' );
}
wp_reset_postdata();
?>
</ul><!--/.products-->