Display The Total Number Of Registered Users

WordPress-Christmas-09Anyone who operates a community using WordPress, and would like to display the total number of registered users, can easily and quickly use the following small code snippet.

It reads via SQL the content of the table "users", and the numbers of IDs getting counted. This value simply gets wrapped around a text.

$myusers = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");
echo sprintf( __('We have %s registered user.', 'myTextDomain') , $myusers );

Feed Cache in WordPress

WordPress already offers the possibility of own functions to read feeds and use it in your blog. Since version 2.8 of WordPress, a new feature is in use for that. So there are two ways to work with feeds in WordPress, and in both functions, the data is cached. But this is not always wanted, so I show how to take influence on caching of the two functions.
Continue reading …