Skip to main content
I removed the code image and added the formatted code instead
Source Link
birgire
  • 67.8k
  • 7
  • 119
  • 251

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!

enter image description here

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++;
}

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!

enter image description here

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!

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++;
}
added 894 characters in body
Source Link

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!

enter image description here

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!

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!

enter image description here

deleted 998 characters in body
Source Link

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++;
}

}

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++;
}

}

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!

added 1000 characters in body
Source Link
Loading
Source Link
Loading