Support » Fixing WordPress » Display Last 5 posts from multiple WP Authors — HELP!

  • Hi.

    I set up a few friends as authors on my blog. I would like to have a Page in which it shows a number of blocks. Each block would contain:
    – Author Name
    – Author About Info
    – Last 5 posts by that Author

    My problem is that I don’t know how to create the loop necessary.

    I know I can get the list of authors with:
    <?php wp_list_authors('show_fullname=1&optioncount=1'); ?>

    And their About info with
    <?php the_author_description(); ?>

    And their Last 5 posts with
    <?php wp_get_archives('type=postbypost&limit=5'); ?>

    I know I will need to create some kind of Loop which will:
    – Query DB for authors

    Start: Loop 1
    – Set some type of author id variable
    – Get the Author’s about info

    Start: Loop 2
    – Query archives to find their last 5 posts
    End: Loop 2

    End: Loop 1

    Any help would be appreciated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi Moshu,

    That got me started a little. I want to be display all of the authors on a single page with the last 5 posts beneath each respective author.

    Here’s what I was able to pull together from other posts:

    global $wpdb;
    $authors = $wpdb->get_col("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = 'wp_capabilities' AND meta_value REGEXP \"author|administrator\"");
    foreach($authors as $author) :
    if(have_posts()) the_post();
    <h3>Latest post from <?php the_author(); ?></h3>
    Read all posts by <?php the_author_posts_link(); ?>

    However, it doesn’t work at all.

    Anyone have any ideas I can try?


    can anyone provide some more direction? Thanks!

    i remember there was a plugin i downloaded lately but lost with format…. you just put the number of last posts to display… anyone knows it?.. it was called “Posts-by-author” i think!!

    i found the plugin..
    This is exactly what you’re looking for, folks….

    Check it out….. and damn it’s resolved now buddy


Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Display Last 5 posts from multiple WP Authors — HELP!’ is closed to new replies.