This article describes how to display the user count on WordPress pages.
If you are running a WordPress site with a large user base, you may want to share the registered user count with all of the visitors to your site. By doing so, you can help encourage them to sign up as well. Many new customers or users equate a large following (or user base) to trust. Additionally, sharing the user count can help show that your site is constantly growing.
To add user count functionality to WordPress, follow these steps:
Copy the following code snippet and then paste it at the bottom of the functions.php file:
function display_user_count() { $usercount = count_users(); $result = $usercount['total_users']; return $result; } add_shortcode('user_count', 'display_user_count');
User count functionality is now enabled, but you must update the post or posts where you want this information to appear. To do this, open a post or page on the site, and then type [user_count] where you want to display the user count. For example:
Save your changes, and then view the post:
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.