• My apologies for the unintended double post – for some reason the topic closed on me and became unopenable.

    Hey guys,

    I’ve been working on a fun little challenge for a little while here and I’ve run out of creative ideas at the moment. I’m hoping someone here can point me in the right direction :).

    Challenge:

    I want to display the latest entry from 3 different authors on the front of a WordPress blog.

    As I understand it, this would simply require three instances of the “Loop”. I’ve been working on it and have easily been able to display the latest post by author in a single entry, but when it comes time to duplicate it and change the author information, things don’t work so well. In general, all the loops would simply display the last of the three author’s data.

    I’m sure this is simply my inexperience with using the Loop showing through at the moment and any help at all would be greatly appreciated :).

    Here’s a sample of some of the code I tried:

    ‘<?php $my_query = new WP_Query(‘author_id=4&showposts=1’);
    while ($my_query->have_posts()) : $my_query->the_post(); ?>

    <!– formatting goes here –>

    <?php endwhile; ?>

    <?php $my_query = new WP_Query(‘author_id=2&showposts=1’);
    while ($my_query->have_posts()) : $my_query->the_post(); ?>

    <!– formatting goes here –>

    <?php endwhile; ?>’

Viewing 2 replies - 1 through 2 (of 2 total)
  • Don’t forget to add this between loops or else it will just continue from the last place in the post table.
    <?php rewind_posts(); ?>

    Also have a look over the documentation for the loop.

    Thread Starter Jonathan Wold

    (@sirjonathan)

    Howdy Jeremy,

    I’ve tried that as well and, with the code above, it simply takes the last author and displays their info. I’ve gone over the documentation in pretty lengthy detail – but I’ll continue looking :).

    Thank you Jeremy. Any additional suggestions are very welcomed,

    -Jonathan

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Question: Using Loop to display multiple authors?’ is closed to new replies.