Basically, I am reading right out of the Codex page for WP_Query.
You want a meta_query similar to this with an orderby parameter with the two values you want to order by. The first is dominant.
$args = array(
'post_type' => 'post',
'meta_query' => array(
array(
'key' => 'rating',
'value' => 3,
'compare' => '>'
)
),
'orderby' => 'rating post_date',
'order' => 'DESC'
);
$query = new WP_Query( $args );
I don’t know what your rating field is named and I don’t have your posts and your ratings on my system so I can’t test that. Hopefully that will get you started.
Related Posts:
- WP_Query sort by meta_value_num or date
- WP_Query orderby not working with meta_value_num and menu_order
- Creating Ordered Query using Meta_key
- How do I reorder (pop and push) items from WP_Query?
- Update all posts automatically when using post_meta
- Reverse chronology of post listing
- Better post meta efficiency?
- Change post format using custom field
- Sanitizing `wp_editor();` Values for Database, Edit, and Display
- What Is meta_id In wp_postmeta?
- Add custom field automatically (add_post_meta) with value based on number of words of article
- Automatic value for custom fields for posts
- is there a way to show the the post title after the image?
- How do I correctly set up a WP-Query to only show upcoming event-posts?
- Query Posts With Over 1000 Views
- Cannot retrieve a custom RSS field from posts
- How to order posts by meta_value and title
- Query Posts by Custom Field
- how to get post order by post id wp_query?
- Customize rel=canonical tag for single blog post
- How to I retrieve the ID from the Posts page?
- Create a list of posts with topic headdings
- if in category but only with post meta
- wp_query with ajax
- Saving Post Data in Another Database
- Need to know custom code to display random and most viewed posts in wordpress posts and pages
- Add multiple meta keys to a post at once
- WP_Query custom field pass the post id
- saving/reading custom field value does not work – no value gets POSTed
- Override WordPress core post-template.php block template
- Post meta not working
- query posts with selected post ids first
- How do you update post date (year only) in a separate custom field?
- How to get value of a selected option from select tag and use it in WP_query to filter posts?
- How do I display posts ordered by a date custom field?
- Random order of the 5 most popular posts
- My custom query is displaying random posts in random order
- Get query result according to merged array
- Show posts between two Custom Fields date
- WP Query between posts custom fields [duplicate]
- Order posts by separate menu order for different sub-categories
- Order by ‘s’ using WP_Query()
- How enter custom post meta or custom field on box post list archive page?
- WP_query sort by custom meta_key “price”
- Image inside the content is replaced with featured image from my older post
- Should we trust the post globals?
- Order by optional meta key?
- Add a checkbox to post screen that adds a class to the title
- Export WordPress Posts and Meta Information in CSV format
- Querying post from a multisite network
- How to know if get_posts() failed?
- Show related posts by category but ignore one category
- HTML code in Custom field
- Guest Author – How to modify my custom function code if the guest author URL will follow a particular pattern/format?
- How to add padding between posts
- Working Bootstrap Carousel Conversion to WP – Technical Questions
- Add few specific post ids to wp_query
- How can I make existing custom fields easier to edit/add in my theme?
- WP_Query posts_per_page ignored
- wp_query ‘s’ parameter does not work with custom post type
- WP Query – duplicated posts once including tags in search results
- how to get posts ids inside pre_get_posts filter?
- Search by post title and content in wp_query without order
- Order Custom Post Type by Custom Field Value
- how to change the number of posts returned in a specific loop without making it global?
- Redirect to another page using contact form 7? [closed]
- How to automate featured posts number? [duplicate]
- Nested WP_Query breaking loop
- How to save meta checkbox WordPress
- Query for first 3 posts to change the look and feel
- Getting blog pagination to work on page set as front page
- unique post in “$args” of wp_query display more than one post
- Custom permalink for each post
- Is there a way getting post fields using `transition_post_status`
- Not all posts showing in query
- WordPress query portfolio posts
- Get latest author posts inside the loop
- Display 3 posts with different HTML markup using a loop
- Why my meta boxes won’t show in front post page?
- How to show multiple posts thumbnail, title and date in widget
- Only the most recent post is showing on my category page (working on localhost, not live site)
- Featured Images most often doesnt appear
- Manipulated offset and pagination, can’t display last post anymore
- How to display particular set of wordpress post on a webpage?
- Show 5 posts and than 3 posts offset with pagination
- Meta key in wp_query bug?
- Is it possible to query a category with specified posts?
- How to retrieve a post by inputing the url in a custom field and displaying it on an options page
- Sorting Posts with meta value not working
- Query to get data of a post, if in category?
- Order posts by custom field
- Ordering posts alphabetically by meta keys and title
- Remove duplicated posts in the loop if post has more than one category
- Why I getting only 1 post?
- 404 on Pages for Custom Post Type & Query_Posts
- get_post_meta property of non object
- First post in loop displays twice
- Site ‘Categories’: save an admin global setting with post metadata [closed]
- WP_Query sort by ACF date field (newest first) with blank dates first
- Is it possible to use the_post 2 times in one loop