Forum Replies Created

Viewing 1 replies (of 1 total)
  • The problem seems to lie in the fact that the wp_list_authors function relies on the admin’s actual user login name rather than a user ID.

    First, open \wp-includes\author-template.php.

    If you haven’t messed around with this file before, what you will be looking for is at Line 189:
    $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'admin' " : '') . "ORDER BY display_name");'

    Now, there are two ways to fix the problem. The first way is to just change the username the query looks for (admin) to whatever the actual login name your admin uses. For example:
    $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_login <> 'steve' " : '') . "ORDER BY display_name");'

    The second way is to change the query so that it searches for the default admin user ID, which is ‘1’. To accomplish this, change Line 189 to:
    $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE ID <> '1' " : '') . "ORDER BY display_name");'

    Hope that helps. 🙂

Viewing 1 replies (of 1 total)