Wordpress, List Authors and Exclude Admin

admin

Administrator
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:

Code:
$authors = $wpdb->get_results('SELECT DISTINCT post_author FROM '.$wpdb->posts);
if($authors):
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