Add total members to “Right Now” dashboard widget
wordpress snippet
Great little snippet that will display the total number of members within the Right now dashboard widget. Just add this to the functions.php of your wordpress theme and you are ready to go.
( example screenshot )snippet : PHPcopy
function dashboard_wps_user_count() {
global $wpdb;
$users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");
?>
<table>
<tbody>
<tr class="first">
<td class="first b b_pages"><a href="users.php"><? echo $users; ?></a></td>
<td class="t pages"><a href="users.php">Members</a></td>
</tr>
</tbody>
</table>
<?}
add_action( 'right_now_content_table_end', 'dashboard_wps_user_count');
this months featured snippets
- Anonymous
- http://wpsnipp.com Kevin Chard
- Ameenullah











