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
- Users as team members through a loop in elementor
- How to fix pagination for custom loops?
- Jquery Slider for profile template
- Counting the posts of a custom WordPress loop (WP_Query)?
- if ( is_home() && ! is_front_page() )
- Get excerpt using get_the_excerpt outside a loop
- How to display Yoast SEO meta description in archive template for each post instead of the_excerpt()? [closed]
- Get post content from outside the loop
- Why should I put if(have_posts()), is while(have_posts()) not enough?
- Display featured products through custom loop in woocommerce on template page
- Split Content and Gallery
- How to get Author ID outside the loop
- How can i display the content in plaintext
- Redirect loop when trying to login to /wp-admin/ [duplicate]
- How to split a loop into multiple columns
- Is it necessary to reset the query after using get_posts()?
- Is there any difference between the_title() and echo get_the_title()?
- AJAX with loop filtering categories
- Do I need to use The Loop on pages?
- Remove the Homepage Query
- remove tags from the_content
- the_title() shows title of the first post instead of the page title?
- How to force excerpts / teasers in the loop
- Retrieve each widget separately from a sidebar
- Why am I being limited to ten posts on a custom loop?
- Should I use loop in the single.php file?
- A search for ‘0’ returns results
- Why do themes rely on “The Loop”?
- How to return loop contents
- 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?
- Insert image or ad script after 3 posts using the loop
- Get date of last update outside of loop
- Pagination not working on home page
- Child Pages Loop
- How to place comments_template(); outside the loop?
- Multiple Loops Homepage?
- How to Change Loop to Order Posts by Views (using wp-postviews plugin)
- how to upload image using wp_handle_upload
- Avoiding using a loop to access a single post
- How to get the first image gallery of a product in woocommerce in a loop
- Get post by page name or slug
- save_post + insert_post = infinite loop
- Loop.php vs looping inside template file
- Get ID of a page containing secondary loop in content
- Custom Loop and Infinite Scroll
- Loop that displays PARENT PAGE & CHILD PAGE & outputs GRANDCHILD PAGE title and content
- 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?
- the_content and wp_link_pages
- How can you make it so the comment box shows on some pages or posts but not all?
- Why did my most recent article fall behind an older one on my site?
- Prevent duplicating specific column from database table
- Two loops in CPT archive page, exclude posts from main query
- Insert multiple custom components after x-number of posts
- Hide old posts each year
- How to get files from loop for zip
- Hook in the loop after the first post
- wp_mail sending only once inside foreach loop
- How to use orderby on meta_value when using Pods custom database table storage
- How can I list users by date in an array in meta_value?
- Landing page with login
- Divide loop into several columns based on post custom field and enable infinite scrolling
- How i can display all posts order by years
- wp_mail function not working in user query loop
- I make sticky post for my archive page for custom post type with ACF field and loop is not working
- How can I create an entirely new, separate display of posts?
- Add static image block to lastest list item
- Query Loop Block: possible to restrict just child pages?
- How to set and retrieve cookies while in the loop
- Use Base-URL with Query-Loop
- Place the Featured image on a post, before the first via code
- Using Query Loop Block to list all posts under each category
- Different date time in results of search
- show title and displaying link gallery
- Alternatives to archive.php
- Add “New” Sale badge to products in WooCommerce based on creation date
- How to make FSE’s query loop to order by comments number?
- Displaying Car Prices from Page Listings on Each Post Car Pages (Post Type) Using ACF
- Unexpected warning message to my WordPress posts which group and listed out by year
- Get last post in loop in WordPress
- Getting the correct post ID in WordPress query loop
- Giving each loop post unique numbers so that WordPress would treat separately
- I’m Trying to Separate the First Post From the Rest of the Loop
- Inside nested wordpress loop (post & post-type) ” in_array()” function can’t retrieve the matching value
- Wishlist Icon in Divi Blog module (loop)
- Dinamis Query Loop template Custom Post Type dan Taxonomy di WordPress Blocks dengan PHP