WordPress
- 8 ответов
- 0 вопросов
5
Вклад в тег
<?php
$args = array(
'post_type' => 'product',
'meta_key' => '_featured',
'meta_value' => 'yes',
'posts_per_page' => 2
);
$featured_query = new WP_Query( $args );
if ($featured_query->have_posts()) :
while ($featured_query->have_posts()) :
$featured_query->the_post();
$product = get_product( $featured_query->post->ID ); ?>
<li class="featured-products-item">
<a><?php the_post_thumbnail();?></a>
<?php the_excerpt();;?>
</li>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query(); // Remember to reset
?>