admin管理员组文章数量:1327945
I am trying to show the most commented post. Only one post should show but I am getting 2 even though the number of comments is not the same?
<?php $args = array(
'orderby' => 'comment_count',
'posts_per_page' => 1,
);
$most_commented = new WP_Query($args);
?>
<?php if ($most_commented->have_posts() ):
while ($most_commented->have_posts() ): $most_commented->the_post();
$author_id = get_the_author_meta( 'ID' );
?>
<?php // display info about blog post here ?>
<?php endwhile; wp_reset_postdata(); ?>
<?php endif; ?>
本文标签: wp queryMost commented post showing 2 records
版权声明:本文标题:wp query - Most commented post showing 2 records 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742224076a2435678.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论