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.
Usamos cookies con el fin de personalizar para usted nuestro sitio Web y analizar el uso de éste. Usted acepta esto haciendo clic en “Acepto” o al continuar usando el sitio Web. Hay más información sobre cookies en nuestra política de privacidad.