The Users extension provides a connection point between the User_Query class and Ajax Load More.
With the Users extension activated, you can create an infinite scrolling list of subscribers, authors, BuddyPress users, or any custom role on your site and display information about each user like you would a standard WordPress post or custom post type.
User Roles
When building a custom shortcode you may choose to display all users or select a specific user_role from the list.
For security (and privacy) reasons the users_role parameter is encrypted before any user query is run by Ajax Load More. This extra measure will help prevent data manipulation of the Ajax $_GET request URL.
Repeater Template
When Ajax Load More runs a WP_User_Query the results of the query can be accessed in Repeater Templates by referencing the $user object.
<div class="author">
<?php echo get_avatar( $user->ID, 72 ); ?>
<h3><?php echo $user->display_name; ?></h3>
<p>
<a href="<?php the_author_meta('user_url', $user->ID); ?>">
<?php the_author_meta('user_url', $user->ID); ?>
</a>
</p>
<p><?php the_author_meta('description', $user->ID); ?></p>
</div>
HTMLShortcode Parameters
The following shortcode parameters are available with the Users extension.
users | Enable infinite scrolling of WordPress users. (true/false). Default = ‘false’ |
---|---|
users_role | The user role to display. Default = null |
users_include | Show specific users. Default = null |
users_exclude | Exclude specific users.. Default = null |
users_per_page | The number of users to display with each query. Default = ‘5’ |
users_order | The order of the displayed users. Default = ‘ASC’ |
users_orderby | Sort retrieved users by parameter. Default = ‘login’ |
Shortcode Builder
The following screenshot illustrates the process of building a Users shortcode with the Ajax Load More Shortcode Builder.
Example Shortcode[ajax_load_more users="true" users_role="Subscriber" users_per_page="2" repeater="template_10" seo="true"]
FAQs
Below are common questions regarding the Users extension. If you have a question and don’t see the answer, please visit the support page and submit your request.