Im using following code for getting most populer post with thumbnail.I have a custom post type taxonomy (Talks). Custom post types(video) have 6 category.
But my code not working. It just getting 1 post.But i have 10 post. How can i fix it?
<?php
$args = array(
'post_type' => 'video',
'showposts' => 10,
'order' => 'DESC',
'meta_key' => 'post_views_count',
'orderby' => 'meta_value_num',
'tax_query' => array(
array(
'taxonomy' => 'Talks',
'field' => 'id',
'terms' => array(
371,
372,
373,
374,
375,
376
)
)
)
); //
$loop = new WP_Query($args);
while ($loop->have_posts()):
$loop->the_post();
?>
<div class="box">
<a class="box-over" href="<?php
the_permalink();
?>">
<?php
if (($video_thumbnail = get_video_thumbnail()) != null) {
echo "<img src='" . $video_thumbnail . "' class='videowisetalksthumb' width='150' height='108' />";
}
?>
</a>
<p class="videotitle"><a href="<?php
the_permalink();
?>"><?php
the_title();
?></a></p>
</div>
<?php
endwhile;
?>
