Your users are the superstars of your multi-user WordPress site. There are many ways to highlight users and authors on your site. We previously showed you how to add an author info box and how to display recently registered users. In this article, we will show you how to display a random list of registered users in WordPress.
The first thing you need to do is copy and paste the following code into your theme's functions.php file or a site-specific plugin.
función wpb_random_users () global $ wpdb; $ randomusers = '
This code queries the WordPress users table in your database and selects a random row, then outputs the results to a bulleted list of the user's avatar and name. If a user has provided the website url in her profile, it will link the username to her website..
The next thing to do is display the list of registered users. To do this, all you need to do is add the following line of code to your theme file where you want the user list to display (such as sidebar.php, footer.php, etc.).
You can also display a list of random users from your site using this shortcode in a post, page or widget.
We hope this article helped you display a random list of registered users on your WordPress site. If you were looking to display a list of your staff members, you should check out this tutorial on how to create a staff list in WordPress.
If you have any questions or comments, please leave us a comment below. Also don't forget to follow us on Twitter and join Google.+