WordPress allows multiple orders with the orderby parameter. https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters
'meta_key' => '_liked', // You do it well
'orderby' => array('meta_value_num' => 'DESC', 'date' => 'DESC'),
Here you tell WordPress to sort by “bigger” likes and last publish date.
Related Posts:
- Query category-specific, paginated posts and allow viewer to change sort order
- Sort query_posts for Parent Pages to menue order or the count?
- change the default order of posts only for specific categories
- How to WP_Query posts order by parent title?
- WordPress sorting posts by date and title using a dropdown
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- reorder a WP_Query, using a dropdown
- Query multiple custom post types in single loop
- Build a content and excerpt grid loop with paging and options for # of posts
- Display sorting options dropdown when using WooCommerce product category shortcode
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- Drop down+sort blog posts date added/most popular
- Using Cookie Data For WP_Query Loop
- wp_delete_post deletes all posts instead of just expired ones
- Alter secondary loop to exclude posts from current page category
- Trim first 2 words of the exceprt
- Display Post co-authored in Author Page
- Sorting Posts | Alphabetical Order
- Looking for most performant way to execute several similar WP queries within shortcodes
- Get the last month with posts using a recursive function…
- WordPress custom slug (endpoint) and compare all links
- wp_query with cat not working
- How to use an associative array in post__in with WP_Query?
- Wp_query: sort by PHP variable
- Recent Posts slider, using WP_Query(), loads duplicate sliders
- How to Sort posts by Vote Count?
- Compare post-IDs within WP_Query? (Less than / Greater than)
- How to use $query->set with post__in?
- Why do WP_Query results change after updating unrelated Advanced Custom Fields (ACF)?
- Display a specific category of products in shop page and disable code for specific actions
- how to fix error “called incorrectly, should not be accessed directly”?
- WordPress, AJAX and pre_get_posts using conditional tags
- get_posts() and WP_query limits ‘AND’ conditions to a maximum of 6 for meta value queries in WordPress
- Exclude posts based on meta value
- Remove echo from shortcode
- How Can I use WP_Query to Only Display 1 Post from Custom Post Type if Query Returns Posts with Matching ID in Custom Field
- Fatal error: Call to a member function query() on a non-object
- unable to use ‘new WP_Query’ in AJAX call
- Display all pages – in order
- How to keep track of when a vote is cast?
- Trouble inputting variable into WP query
- WP_Query | IF within $args array | Help me only add specific arguments if the argument is not blank
- Array to string conversion on array_map
- Target post_date_gmt if it’s empty or not set
- Get all posts as an array ID => Name
- How to hide posts of a specific custom category in WordPress?
- Passing an array into WP_Query as a variable
- Custom query vars filters problem with pagination
- WordPress meta_query >= &
- Do not duplicate posts with multiple categories in multiple loops
- Infinite Loop – WP_Query
- Dividing the loop to style post differently
- Displaying Event within two given time frames
- Remove Post if Advanced Custom Field is checked to fix paging
- WordPress SQL JOIN query
- WP_Query and help with the loop for magazine front page
- orderby ignored by wp_query
- Search AJAX Filters – Multiple Query Loops Into One Loop (Optimization)
- WP_Query: How to get results from both meta_key options?
- search.php to search only the post title
- Output product category link from WP_Query
- Passing in MySQL prepare statement parameter separately throwing error
- wp_Query with mutuplea values returns all posts
- Load more posts using AJAX based on posts inside WP_Query
- Custom search query on WordPress page not working
- How to select post ID for given parent name with nested prepared queries?
- posts_per_page displays only 2 posts instead of 4 posts
- Use WPQuery to match to specific repeater row in post
- WP_QUERY post_in problem
- how to get data from two different table from wordpress database
- Assign meta_query value to php variable
- Need to show 7 posts from actual date
- Add code to the header of posts by particular author
- Paged WP_Query is quitting on page 3
- Get Child of Child Pages in custom Menu
- WordPress search query, how to modify the sql
- Modify post image in full size
- How to override WooCommerce Order Item Meta with data from Cart?
- Meta query not showing result properly
- Help on Wp_query to print an term
- Making list of posts with chosen description
- Ordering / grouping posts by datepicker ACF
- Include search tags and users in my search results system
- Add custom taxonomy to custom search for posts
- making a search.php query
- Array sorting assistance
- My query keeps looping infinitely ! how to stop it?
- Efficient way of querying for a “fallback” post?
- How to add thumbnails from recent posts to owl-carousel in wordpress automatically?
- Only Get A Certain Number of Posts From WP_Query
- Create a hierarchical loop at predefined markup requirements
- Querying posts based off a jquery datepicker
- Use custom get results query to show posts WordPress
- Page 2+ of taxonomy archives does not recognise sort-order from dropdown
- Query seems to be duplicated
- ISOTOPE – Missing/Invalid Arguement Get Terms
- Keeping the previous get value and add another value when submitted
- Pagination in category.php not functioning
- How do I exclude the current post from the upcoming post query
- using custom pages for myaccount in woocommerce