#How to get the number of registered wordpress users?
The example in this article describes the method of obtaining the number of WordPress registered users and shares it with everyone for your reference. The specific implementation method is as follows:
Recommended: "wordpress tutorial"
Method 1, the code is as follows:
The code is as follows:
global $wpdb $users = $wpdb->get_var("select count(id) from $wpdb->users"); echo "总共有 ".$users." 位注册用户";
Method 2, the code is as follows:
The code is as follows:
$users=wp_list_authors('echo=0&exclude_admin=0&hide_empty=0&optioncount=1&style=0'); $users=split(',',$users); echo '本站有', count($users), '位注册用户'; ?>
I hope this article will be helpful to everyone in building a WordPress website.
For more WordPress related technical articles, please visit the WordPress tutorial column: https://www.php.cn/cms/wordpress/
The above is the detailed content of How to get the number of registered wordpress users. For more information, please follow other related articles on the PHP Chinese website!