Domanda

Problema

Ho questo codice in Functions.php ma non emette il numero totale di membri (qualcosa non va, si rompe il sito) nella mia dashboard "in questo momento". C'è un modo per risolverlo?

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

Funzione aggiuntiva

C'è anche un modo per mostrare quanti autori sono registrati e quanti abbonati sono registrati anche nella dashboard "in questo momento"?

Nessuna soluzione corretta

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a wordpress.stackexchange
scroll top