WordPress tutorials: Total number of members

Wpsnipp – If your blog allow user registration, what about displaying the total number of registered users? This simple code will allow you to do it easily.Adding this PHP code into your wordpress theme will display the total number of members.



$users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");
echo $users." members.";

Leave a comment