Have you enabled user registration on your WordPress site? Does your blog accepts Community Members Registation? Then below short code will help you show Total Number of Registered Users of your WordPress Blog.
Put below code anywhere in your theme’s file i.e. Single.php, Header.php, index.php, etc where you want to show your user count.
WordPress provides a global variable, $wpdb, which is an instantiation of the class already set up to talk to the WordPress database. Always use the global $wpdb
variable. (Remember to globalize $wpdb before using it in any custom functions.)
<?php global $wpdb; $user_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->users" ); echo "<p>User count is {$user_count}</p>"; ?>
Simply save the file, clear the cache and reload page. You should see total # of users on that page.
Do let me know if you see any problem with this.