May 14, 2009

Display the total number of users of your WordPress blog

wordpress-logoPro Blog Tutorials has again brought to us another very useful and practical tutorial in the WordPress realm. With this simple code and WordPress hack, you will be able to show the total number of  users for your WordPress blog, anywhere you want in your template.

Just place the following code anywhere in your template for the number of registered users on your WordPress blog to be shown:

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

Previous Post and Next Post


Try HostGator Webhosting for 1 cent for the 1st Month Click here and enter "wordpress"

Leave a reply

* means field is required.

*

*