Try this code, but replace METAKEY
to the key-name of your metadata.
<?php
function cmp( $a, $b )
{
if( $a->METAKEY == $b->METAKEY ){ return 0 ; }
return ($a->METAKEY < $b->METAKEY ) ? -1 : 1;
}
?>
<ul>
<?php
$args = array(
'role' => 'author' ,
'meta_key' => 'METAKEY',
'number' => 5,
);
$blogusers = get_users($args);
usort($blogusers ,'cmp');
foreach ($blogusers as $user) {
echo '<li>' . $user->display_name . '</li>';
echo get_user_meta($user->ID, 'METAKEY', true);
}
?>
</ul>
Related Posts:
- How to get all multi-select user meta values and add them to an array?
- Show newly added posts since last user login time /date
- Custom search form to display users only
- How do I make a variable available inside partials?
- Enabling users to control custom loop’s query
- How to get user ID’s from multiple usernames?
- Query users and count totals based on meta values
- Loop random posts and display odd and even based on two alternating meta values?
- Show a list of user posts in the user admin page
- Get Sticky User in user loop based on user role
- Display all existing members
- Combine Query and Select Database to create directory loop
- Counting the posts of a custom WordPress loop (WP_Query)?
- Get post content from outside the loop
- Is there any difference between the_title() and echo get_the_title()?
- Using the Loop to show all levels of subpages under a parent page? Halfway there
- Cleanest Way to Select Every Second Element in a Loop?
- Pagination not working on home page
- How to Change Loop to Order Posts by Views (using wp-postviews plugin)
- is_home, and is_front_page conditional problem
- Is `query_posts` really slower than secondary query?
- Are there any scenarios where the query_posts may be used?
- Display subpages under parent page as a list within a loop
- When to use wp_reset_postdata();
- Why do themes have `while( have_posts() )` in templates like single.php?
- Related Posts loop – offset
- Too many nested wp_query loops in this hypothetical query?
- pop-up lighbox with AJAX
- WordPress Loop Through Particular Pages
- Showing current subcategory
- Display date only once for a each set of posts relating to that date
- WordPress Loop – Style rows of posts differently
- Generating dynamic Tabs with multiple query post loop
- How do I override part of the main loop in my child theme?
- Chopping up a large ajax request of around 200 posts [closed]
- Combining the_excerpt with the_content
- Custom loop with conditional statement to separate each terms
- How to get an array of years from all of the search results, and use it to filter by year the paginated loop?
- Only display videos and images in the_content() within loop
- Get search.php results in header.php?
- Recent posts on a static home page
- Query last updated posts (posts updated in the last 24 hours)
- I write simple wordpress loop for taxonomy.php file but don’t show result
- Publish Categories for a particular Author on a given Post
- Do I need to use The Loop on pages?
- How to hook into container
- Exclude first post (sticky or not) from the loop using query_posts()
- How to add a specific div element to the first post in a row?
- While loop with bootstrap [closed]
- Need to add class to first element in a foreach loop
- Scrolling Posts with Ajax
- Sort posts by first letter in the title, not by first number
- how to replace get_template_part(‘loop’,’tag’) with explicit styled version?
- What PHP Needed to Make One Loop with Multiple Styling?
- Simple foreach loop help needed in wordpress “the loop”
- Get paged outside of loop?
- Show scheduled posts in loop (but don’t link to them)?
- How to get a count of all posts in foreach loop and split into fourths
- Grabbed Post ID under WP loop, but still couldn’t Print Post title
- How to loop through yoast primary categories? [closed]
- WordPress get post thumbnail url
- Blank content php code not parsing advanced custom fields gallery add-on [closed]
- Three Column Loop
- Split loop into columns
- get_posts() forcing ignore sticky posts on main loop
- display post tags on single.php inside loop
- Custom content before post content
- Can’t get the previous and next posts permalink
- Adding first and last classes to three column layout in Bones boilerplate
- make diffrent template on last six post published
- Modifying a Loop to Show More
- Does search.php autofilter The Loop?
- Help with if and else statement
- Building a form with WordPress, and also pulling that data for a user page
- Adding a second loop breaks everything
- Custom Query with Sticky Posts
- is it bad to copy the loop for a template?
- I want to load post in bootstrap Modal dynamically
- Why my loop is repeat?
- Excerpts not showing on main page
- Return only one post format in index.php [duplicate]
- How to display just video post format?
- Is it possible to get a post ID of a 2 different custom post types loop embedded in the same post to perform update_post_meta from the frontend?
- Loop shows post 5 times in a query
- How to execute custom loop before loop content?
- Make custom WordPress comments list
- Template included with plugin doesn’t return all posts for custom taxonomy
- Sorting posts to make those with post thumbnail show up first
- Best way to check if a post with specific meta exists
- Return only content in excerpt field in loop
- Default Template infinite loop of Title
- get_posts and wp_autop (remove filter)
- Trouble preventing duplicate posts between 2 loops on homepage
- Change the way wordpress outputs images or image galleries
- How can I access ‘key’ and ‘value’ from an array in a for loop?
- How to get current page id and compare it to looped pages inside the same page?
- posts_nav_link() not working on index.php
- Error in Wordprewss loop for page template [closed]
- Tags outside the loop
- How to get files from loop for zip