I'm attempting to display the latest 5 post excerpts from 5 different authors in my blog sidebar. Below is the code I'm using which I tweaked from this thread: Find most recent authors
So far, I've gotten it to work however rather than display each individual author's most recent post, it's showing the author's earliest post. Any ideas on what I'm doing wrong? I've been struggling w/ this for a few days so appreciate any direction you can give. I'm a newbie to PHP but can understand enough to tweak code. Thanks!! You can see it working on my site: wearestd.com
<?php
global $wpdb;
$post_IDs = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY post_author ORDER BY post_date DESC LIMIT 5" );
$my_query = new WP_Query( array( 'post__in' => $post_IDs) );
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<?php userphoto_the_author_thumbnail() ?>
<div id="author_excerpt"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><h4><?php the_title(); ?></h4><br />
<?php the_advanced_excerpt('length=50'); ?></a>
<?
endwhile;
}
?>
DESCtoASCin the sql query. – Bainternet♦ Jul 6 '11 at 7:07