Skip to main content
2 of 5
added 1000 characters in body

Display Authors Selectively

can I check if it's possible to hide some of the authors and display them selectively? For example, I would like to display Jerrell Seah (no avatar shown) into one of the main 12 who have avatars.

enter image description here

Thanks!

p.s my code is below.

global $wpdb;

$authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users WHERE user_nicename != '' ORDER BY display_name");
$i=1;
foreach($authors as $author) {
    echo "<div class='col-md-3 individual-author'>";
    if($i<=12){
        echo "<div class='author-image-container'>";
        echo "<a href=\"".get_bloginfo('url')."/author/";
        echo $author->user_nicename;
        echo "\">";
        echo get_avatar($author->ID,200);
        echo "</a>";
        echo '</div>';
    }
    echo "<div class='author-name'>";
    echo "<a href=\"".get_bloginfo('url')."/author/";
    echo $author->user_nicename;
    echo "\">";
    the_author_meta('display_name', $author->ID);
    echo "</a>";
    echo "</div>";
    echo "</div>";
    echo ($i==12)?"<div class='clearfix horizontal-rule'><hr/></div>":"";
    $i++;
}

}