List total number of users that are authors

count_users() should give you an array of all the required user counts.

You can use it like this.

$user_counts = count_users();

$authors = $user_counts['avail_roles']['author'];    //Get the author count
$subscribers = $user_counts['avail_roles']['subscriber'];    //Get the subscriber count

echo $authors. ' Authors so far';
echo $subscribers. ' Subscribers so far';

Leave a Comment