• I’d like to re-order the Authors Page to list alphabetically, by display_name. Anyone have suggestions of the best way to tweak this in?

Viewing 2 replies - 1 through 2 (of 2 total)
  • it sucks but it seems this is impossible to do. anyone has any suggestions?

    function contributors() {
        global $wpdb;
    
        $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users WHERE display_name <> 'admin' ORDER BY display_name");
    
        foreach ($authors as $author ) {
    
        echo "<li>";
        echo "<a href=\"".get_bloginfo('url')."/author/";
        the_author_meta('user_nicename', $author->ID);
        echo "/\">";
        echo get_avatar($author->ID);
        echo "</a>";
        echo '<div>';
        echo "<a href=\"".get_bloginfo('url')."/author/";
        the_author_meta('user_nicename', $author->ID);
        echo "/\">";
        the_author_meta('display_name', $author->ID);
        echo "</a>";
        echo "<br />";
        echo "Website: <a href=\"";
        the_author_meta('user_url', $author->ID);
        echo "/\" target='_blank'>";
        the_author_meta('user_url', $author->ID);
        echo "</a>";
        echo "<br />";
        echo "Twitter: <a href=\"https://twitter.com/";
        the_author_meta('twitter', $author->ID);
        echo "\" target='_blank'>";
        the_author_meta('twitter', $author->ID);
        echo "</a>";
        echo "<br />";
        echo "<a href=\"".get_bloginfo('url')."/author/";
        the_author_meta('user_nicename', $author->ID);
        echo "/\">Visit&nbsp;";
        the_author_meta('display_name', $author->ID);
        echo "'s Profile Page";
        echo "</a>";
        echo "</div>";
        echo "</li>";
        }
        }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Order authors list alphabetically, according to Display_Name’ is closed to new replies.