Title: Paging page with users
Last modified: August 19, 2016

---

# Paging page with users

 *  [thomasfals](https://wordpress.org/support/users/thomasfals/)
 * (@thomasfals)
 * [15 years, 12 months ago](https://wordpress.org/support/topic/paging-page-with-users/)
 * I have a user page at my site showing nice name and avatar. After 1 week there
   is already 400 users at the site, and the users page is getting slow to load.
   How can I paginate the page? Below is the code I use to display the authors:
 *     ```
       <?php
       						// Get the authors from the database ordered by user nicename
       							global $wpdb;
       							$query = "SELECT ID, user_nicename from $wpdb->users ORDER BY user_nicename";
       							$author_ids = $wpdb->get_results($query);
   
       						// Loop through each author
       							foreach($author_ids as $author) :
   
       						// Get user data
       							$curauth = get_userdata($author->ID);
   
       						// If user level is above 0 or login name is "admin", display profile
       							if($curauth->user_level > 0 || $curauth->user_login == 'admin') :
   
       						// Get link to author page
       							$user_link = get_author_posts_url($curauth->ID);
   
       						// Set default avatar (values = default, wavatar, identicon, monsterid)
       							$avatar = 'wavatar';
   
       					?>
                           <div class="authorpost overview">
                               <a class="authorimage" href="<?php echo $user_link; ?>" title="<?php echo $curauth->display_name; ?>">
                                   <?php echo get_avatar($curauth->user_email, '40'); ?>
                               </a>
                               <?php echo $user_registered ?>
                               <a class="title" href="<?php echo $user_link; ?>" title="<?php echo $curauth->display_name; ?>"><?php echo $curauth->display_name; ?></a><br />
   
                           </div>
       					<?php endif; ?>
       					<?php endforeach; ?>
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [vtxyzzy](https://wordpress.org/support/users/vtxyzzy/)
 * (@vtxyzzy)
 * [15 years, 12 months ago](https://wordpress.org/support/topic/paging-page-with-users/#post-1588976)
 * The template in this [pastebin](http://wordpress.pastebin.com/0xwdscTp) shows
   a technique for paginating any array.
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [15 years, 12 months ago](https://wordpress.org/support/topic/paging-page-with-users/#post-1588977)
 * For your consideration.
    [http://codex.wordpress.org/Function_Reference/paginate_links](http://codex.wordpress.org/Function_Reference/paginate_links)
 * Very nifty little function that can be used with regular WordPress loop queries
   or your own, like above.
 * Docs leaves a little to be desired(examples i don’t find very clear), but should
   be adequate enough to follow.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Paging page with users’ is closed to new replies.

## Tags

 * [paging](https://wordpress.org/support/topic-tag/paging/)
 * [users](https://wordpress.org/support/topic-tag/users/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * Last activity: [15 years, 12 months ago](https://wordpress.org/support/topic/paging-page-with-users/#post-1588977)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
