I am re-using some old code on a new website where I show all users in a listing with last post image as background. This all works fine (I know the get_users_of_blog is deprecated, but when I use get_users my code breaks)...
<?php
$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(); ?>
...........
<?php endwhile;
}
}
}
?>
The thing is I can't get it ordered by name and exclude authors in the list. I tried doing this
$blogusers = get_users_of_blog(array('role' => 'editors', 'orderby => ID));
But this is not doing a darn thing. Anyone? Thank you!