Question: Using Loop to display multiple authors?
-
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; ?>’
- The topic ‘Question: Using Loop to display multiple authors?’ is closed to new replies.