Wordpress, List Authors and Exclude Admin


Staff member
I am trying to loop through authors in my wordpress blog but something weird keeps happening, probably because I haven't fully grasped how to use the functions. When I do this:

$authors = $wpdb->get_results('SELECT DISTINCT post_author FROM '.$wpdb->posts);
foreach($authors as $author):
if(the_author_meta('display_name', $author->post_author) != 'admin'): //my line

I am trying to exclude the "admin" user from my loop, but when I execute this. I get the all authors names shown twice on the page including the admin. So the conditional is not acting as a conditional but rather an echo!

What I am doing wrong?

Thanks all