Here is my code. I only want to display The authors and exclude the rest of the user roles. Please help, I only have a few strands of hair left!!!!
function contributors() { global $wpdb;
$authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users ORDER BY display_name");
foreach($authors as $author)
{
echo "< li >";
echo "< a href=\"".get_bloginfo('url')."/?author=";
echo $author->ID; echo "\">";
echo get_avatar($author->ID, 125);
echo "";
echo '';
echo "< a href=\"".get_bloginfo('url')."/?author=";
echo $author->ID;
echo "\">"; the_author_meta('display_name', $author->ID);
echo "";
echo "";
echo ""; } }
Since I don't know how or where wordpress stores users roles, I suggest to use
get_role()
like this: