I want to show author's limited post
titles
on the author page. I'm using the code outside the wordpress loop
to show limited post of author and the code is <?php query_posts('posts_per_page=20'); ?>
<?php query_posts('posts_per_page=20'); ?>
. but its showing recent post and i want only posts from author.
How to do this, anybody have idea?
use
query_posts('posts_per_page=20&author=$ID');
or use
query_posts('posts_per_page=20&author_name="admin"');
Sample Code
<?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();
?>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.