[英]Wordpress: How to display post count in author page by custom taxonomy
[英]How to call limit post of author on author page (wordpress)
我想在作者页面上显示作者的有限post
titles
。 我在wordpress loop
外使用代码来显示作者的有限帖子,并且代码是<?php query_posts('posts_per_page=20'); ?>
<?php query_posts('posts_per_page=20'); ?>
。 但它显示最近的帖子,我只想要作者的帖子。
怎么做,有人有主意吗?
采用
query_posts('posts_per_page=20&author=$ID');
或使用
query_posts('posts_per_page=20&author_name="admin"');
样例代码
<?php
$the_query = new WP_Query(array('posts_per_page'=>20,'author'=>$put_author_id_here) );
while ( $the_query->have_posts() ) : the_post();
/* display the post as you do in loop*/
endwhile;
wp_reset_postdata();
?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.