Do you want to display the total number of WordPress users on your entire site? Use the following code to get the total number of users, and then display it in your theme. This returns ALL users, regardless of User Level.
<?php // Get total number of users $total_users = count_users(); echo $total_users['total_users'] . ' users.'; ?>
$total_users variable will just return the number. You can change the word “users” to say whatever you want (registered users, people, etc.).
I’d love to see how you use this. Please share in the comments.
Reference count_users() in the WordPress Codex.