Title: custom user order
Last modified: August 22, 2016

---

# custom user order

 *  Resolved [Buchanan Webmaster](https://wordpress.org/support/users/jeffsydor-bipc/)
 * (@jeffsydor-bipc)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/custom-user-order/)
 * [http://www.knowingimmigrationlaw.com/contributors/](http://www.knowingimmigrationlaw.com/contributors/)
 * The client has requested a custom order to the list of contributors. Not alpha-
   numeric like originally used. This is what I’ve done:
 * Installed the Advanced Custom Fields Plugin by Elliot Condon and created a field
   that is named “rank”. It is a dropdown list with the numbers 1-8. It is only 
   assigned to users that equal “author” with no default value.
 * Then, I assigned each user the ranking they were requested. Lastly, in my template
   file I used the following code:
 *     ```
       <?php 
   
       $allUsers = get_users('meta_key=rank&order=DESC');
   
       $users = array();
   
       // Remove subscribers from the list as they won't write any articles
       foreach($allUsers as $currentUser)
       {
       	if(!in_array( 'subscriber', $currentUser->roles ))
       	{
       		$users[] = $currentUser;
       	}
       }
   
       ?>
       ```
   
 * On my local testing machine, this works perfectly. On the server I uploaded it
   to, I get a random listing which is being shown.
 * Any help would be appreciated. Thanks.

Viewing 1 replies (of 1 total)

 *  Thread Starter [Buchanan Webmaster](https://wordpress.org/support/users/jeffsydor-bipc/)
 * (@jeffsydor-bipc)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/custom-user-order/#post-5871978)
 * Nevermind, i figured it out. I was missing the ‘orderby=meta_value’ in the get_users
   array.

Viewing 1 replies (of 1 total)

The topic ‘custom user order’ is closed to new replies.

## Tags

 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [filter](https://wordpress.org/support/topic-tag/filter/)
 * [get](https://wordpress.org/support/topic-tag/get/)
 * [get_users](https://wordpress.org/support/topic-tag/get_users/)
 * [list](https://wordpress.org/support/topic-tag/list/)
 * [users](https://wordpress.org/support/topic-tag/users/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [Buchanan Webmaster](https://wordpress.org/support/users/jeffsydor-bipc/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/custom-user-order/#post-5871978)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
