Ok, I know the code to display authors with latest post and image on the sidebar as below. I now need to:
1)- exclude admin,
2)- display 5 authors (most recent 5 authors who published a post)
<?php
//get all users, iterate through users, query for one post for the user,
//if there is a post then display the post title, author, content info
$blogusers = get_users_of_blog();
if ($blogusers) {
foreach ($blogusers as $bloguser) {
$args = array(
'author' => $bloguser->user_id,
'showposts' => 1,
'caller_get_posts' => 1,
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<div style="border-top:1px solid #bababa; margin:0">
<?php echo get_avatar( get_the_author_email(), '80' ); ?>
<h4 style="padding-top:10px;"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a><br /><small><?php the_author_posts_link(); ?> </small></h4>
<?php
the_excerpt();
?>
<p class="more-link"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" style="color: rgb(157, 20, 20); font-weight: bold;"><?php _e('Read', 'news'); ?></a> | Comments (<?php comments_number('', '1', '%'); ?>)</p>
</div>
<? endwhile;
}
}
}
?>