Thats code just querying the posts by sorting it by meta value, but you have no loop for the posts to display. Add the loop after the query for something like this:
echo '<ul>';
if ( have_posts() ) : while ( have_posts() ) : the_post();
echo '<li>';
the_title();
echo '</li>';
endwhile;
endif;
echo '</ul>';
Related Posts:
- Can’t get full post title if there a spaces in title
- How to display only one category in a custom post type?
- Adjust the order for returned posts
- Get first comment link on the post itself
- How to limit the number of posts that WP_Query gets?
- Should we trust the post globals?
- Random sort within an already sorted query
- Dynamically add id to heading tags
- Confirmation box when submitting post for review
- how to get a different html for odd/even posts?
- Publish pending article from front end with a button?
- List latest posts in WP-Admin
- How to know if get_posts() failed?
- Alter query on edit.php
- Change slug with custom field
- Restrict access to post if it is currently being edited
- WordPress Number of Posts Not Changing With posts_per_page
- Getting an alphabetic post list with two letters onclick on letter
- Duplicate posts
- Looping through posts per category gives same posts for each category
- which action to hook to in order to perform post-publish action
- Trying to put an array into ‘post__in’ => array() query not working
- Strange switch_to_blog() issue
- POST from jQuery to PHP
- Query All users that has post
- $post object is null
- Advanced Custom Fields – Storing array value for further usage
- Search query – exact post title match
- Check if post exists
- Display page content AFTER a loop of posts
- str_replace the_title(); blues
- Get posts by multiple ID’s (query)
- How to start with post number x?
- Exclude posts with empty post_content in wp_query
- Only display a certain number of posts, dependent on how many posts there are available in a query
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- Query how many items to show in shortcode
- Sticky post appears twice
- WordPress Custom Fields (Checkboxes with multiple values)
- How Can I Query a Specific Page From a MultiPage paginated Post
- Exclude the first ‘n’ number of posts of a tag from home page?
- Creating a post from data returned from HTML form
- How to get posts and comments amount per hour, per year and per month?
- Page template is accessing the incorrect posts?
- Inner join overrides Advanced Custom Fields plugin’s get_field [closed]
- Counter is skipping post when I still want it visible [closed]
- How to get all post_parents of a post?
- Get post meta retrieving wrong value
- Run query_posts if SESSION is empty?
- WordPress query undefined offset in loop
- Exclude some posts from displaying in wp_query based on some condition
- displaying the categories post
- get last post’s link with SQL query
- post/page content
- Trim posts from WP-Query?
- How To Use Custom Fields With .mp3 Links
- Custom Select Query – Selecting the Year?
- Defining ‘last’ class on foreach blog posts
- Categories Listing and Highlighting current category item
- A better code for no post format?
- Help Combine These Two PHP Codes
- WordPress, custom post type and posts query help!
- Advanced Query posts
- WordPress Query – Display 5 posts (same post type), each from a given tag
- how to add tags to post in the Loop?
- Merge get_comments & get_posts into a single query
- My Custom Post Type AJAX Query is Returning no posts – why?
- out of nowhere
- Ignore posts content in the posts queries for internal linking
- Let user select the number of posts shown per page jquery error
- Bulk Post update_post_meta
- AJAX load more posts not using correct category and repeating the same few posts
- Sort Events by Venue Title – Sort Post set by related post ids
- Query post for today, if no post get the previous one
- Display the latest post from some selected authors
- Advanced Post Display/Pagination/Ordering
- Displaying Results From Custom Taxonomy Query
- Sort post by category using HTML Select tag
- Show a Category Specific Info Box
- How to get all the terms of a post
- WP_Query retrieve custom posts but not the post showing
- How can I create a menu items from meta box based on users input
- Special Query: Title, Terms, Content – %LIKE%
- How do I display a full post, not just an excerpt?
- Make division in post_query?
- List direct children of page
- Unable to get posts with category on my page
- wordpress radio button on single post page
- Create post from form with image
- Display one post randomly from category on home page
- Exclude a ‘portfolio’ custom category?
- Display a custom field rating system in the front end
- get value from post to sidebar
- Echo author slug in post edit page
- Adding a content rating system
- How to set value in Query Loop?
- Wp_query WooCommerce products
- CSS code for “inserting a custom post divider” after each post
- Display posts with id equal to relationship value
- Sort Posts Alphabetically Based on Specific Category (Divi)