Home > CMS Tutorial > WordPress > How to get the number of registered wordpress users

How to get the number of registered wordpress users

藏色散人
Release: 2019-12-26 10:16:21
Original
2757 people have browsed it

How to get the number of registered wordpress users

#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." 位注册用户";
Copy after login

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), '位注册用户'; ?>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template