Title: Member Directory Order
Last modified: October 19, 2023

---

# Member Directory Order

 *  Resolved [bubbleck](https://wordpress.org/support/users/bubbleck/)
 * (@bubbleck)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/member-directory-order/)
 * Hi there, we are using the member directory to show exhibitors for an event. 
   The event has some exhibitors that pay to be sponsors and therefore we would 
   like them to appear first on the directory. We are displaying the members in 
   alphabetical order by default, but is there a way we can overwrite this for the
   sponsors to make them come first?
 * Many thanks, Caroline
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fmember-directory-order%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [missveronica](https://wordpress.org/support/users/missveronicatv/)
 * (@missveronicatv)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/member-directory-order/#post-17137050)
 * [@bubbleck](https://wordpress.org/support/users/bubbleck/)
 * You can try this code snippet.
 * The settings required:
    1. Crete a dropdown field in UM Forms builder with Meta
   Key `is_featured`. 2. Give the dropdown two possible values `0` and `1`. 3. Set
   the field Privacy to Administrator role only. 4. As an Administrator edit a User
   from frontend and set this field value to 1. 5. Show Members Directory.
 *     ```
       add_filter( 'um_prepare_user_query_args', 'um_custom_prepare_user_query_args', 999999 );
   
       function um_custom_prepare_user_query_args( $args ) {
   
           $args['meta_query'][ ] = array(
               'relation' => 'OR',
                   'featured_clause' => array(
                           'key'     => 'is_featured',
                           'value'   => '1',
                           'compare' => '='
                       ),
                   'regular_clause'  => array(
                           'key'     => 'is_featured',
                           'value'   => '0',
                           'compare' => '='
                       ),
                   'newb_clause'     => array(
                           'key'     => 'is_featured',
                           'compare' => 'NOT EXISTS'
                       )
                   );
   
           $args['orderby'] = array(
                           'newb_clause'     => 'ASC',
                           'regular_clause'  => 'ASC',
                           'featured_clause' => 'ASC',
                           'user_login'
                       );
   
           return $args;
       }
       ```
   
 * Install the code snippet into your active theme’s `functions.php` file
    or use
   the “Code Snippets” plugin.
 * [https://wordpress.org/plugins/code-snippets/](https://wordpress.org/plugins/code-snippets/)
    -  This reply was modified 2 years, 8 months ago by [missveronica](https://wordpress.org/support/users/missveronicatv/).
 *  Thread Starter [bubbleck](https://wordpress.org/support/users/bubbleck/)
 * (@bubbleck)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/member-directory-order/#post-17145304)
 * Thank you, this is really helpful. I hade to change the following lines to DESC
   instead of ASC to get the featured profiles to go to the top, but it has worked.
 *     ```wp-block-code
                           'featured_clause' => 'DESC',
                       'newb_clause'     => 'DESC',
       ```
   
 * Thanks again.

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

The topic ‘Member Directory Order’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-member/assets/icon-256x256.png?rev=3160947)
 * [Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin](https://wordpress.org/plugins/ultimate-member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-member/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-member/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [bubbleck](https://wordpress.org/support/users/bubbleck/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/member-directory-order/#post-17145304)
 * Status: resolved