Question

Problem

I have this code in functions.php but it does not output the total number of members (something is wrong with it it breaks the site) in my "Right Now" dashboard. Is there a way to fix it?

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');

Additional feature

Also is there a way to show how many authors are registered and how many subscribers are registered also in the "Right now " dashboard?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top