I don’t think there’s an easy to sort by three different meta values, and really, I don’t see why you need to in this case. Why not just save the event date in one meta value and sort by that? It makes your query much more efficient (removes two unnecessary joins) and lets you use the WP_Query orderby
field to sort your posts rather than writing a custom query or filtering each of the SQL clauses of the query to make it do what you want.
Related Posts:
- How to fix pagination for custom loops?
- How to display SQL query that ran in query?
- Pagination not working with custom loop
- How can I create a meta_query with an array as meta_field?
- Query multiple meta key values?
- How to Optimize WP site for millions of posts
- Should we trust the post globals?
- Query multiple custom post types in single loop
- How to get comments by post ID?
- WP_Query vs get_posts
- Remove the Homepage Query
- Differences between wpdb->get_results() and wpdb->query()
- Is there a way of increasing the speed of this query?
- Display category posts grouped by taxonomy
- Usage of the new “posts_clauses” filter in WordPress 3.1?
- Get all image from single page using this query
- How can I query all users who registered today?
- Get Terms by IDs with IDs order
- Reversing the order of posts AFTER the query is performed
- How to use a custom post type as front page?
- what are the numbers between curly brackets in search query
- simple sql query on wp_postmeta very slow
- Using WordPress public query variables
- WP_Query: query posts by ids from array?
- How to Use Wildcards in $wpdb Queries Using $wpdb->get_results & $wpdb->prepare?
- When/why does ‘$query->get( ‘tax_query’ );’ return empty?
- How to get link and title of next and previous post on single page
- Create pagination and order according to alphabet
- wpdb get posts by taxonomy SQL
- How to List Events by Year and Month Using Advanced Custom Fields?
- Is there any difference between hooks posts_where with posts_join and posts_search performance wise?
- wordpress query – orderby child post date
- How many WordPress SQL Queries per page?
- pre_get_posts with get_posts
- How to display Section for certain time
- Add multiple value to a query variable in WordPress
- Search custom post type by meta data
- Custom query_var causes displaying posts archive on front page
- Slow wp_enqueue_media()
- Rearranging posts based on categories
- Multipart/formatted MySQL query problem
- What is the most efficient way of implementing a favorite post system?
- Query Custom Meta Value with Increment
- Remove [gallery] shortcode altogether
- Is `query_posts` really slower than secondary query?
- Compare two numeric custom fields
- Are there any scenarios where the query_posts may be used?
- wp_dropdown_categories with multiple select
- Advanced Custom Fields – Query Efficiency
- Why does get_the_time(‘F j’) return November 30 for all posts?
- Identify which loop you are hooking into; primary or secondary?
- Query by one meta_key and sort by another (possibly NULL value)
- How to tune search argument in WP_Query to show only exactly the same results?
- Custom query filter not working on woocommerce category page
- How to delete a transient on post/page publish?
- Very slow query
- query multiple taxonomy and show post count
- Search Terms – Querying on either description__like OR name__like in the same Term Query?
- WordPress Number of Posts Not Changing With posts_per_page
- Query & Sort Comments by custom comment meta
- How to get my loop to pull posts into three columns
- How to display lastest post date in the homepage?
- Looping through posts per category gives same posts for each category
- Custom $wpdb Query for Custom Post Type by Category
- Transient not working for custom loops
- Get a user’s most recent post title
- Categories and products in random order
- add_query_arg() XSS Vulnerability
- Looping Through Custom Tax Terms and Displaying All Posts For Each
- Count user posts by user ID, Post type and Post status
- Can’t pass table to $wpdb->prepare
- Query set using tax_query with relation ‘OR’ modifies category object?
- $query->query_var[‘post_type’] not set for pages
- is_archive() doesn’t work on public query var archive pages?
- How to extract all ID variables from a query string?
- When add_query_arg() is necessary?
- Different Main Navigation per category
- How to get category link without a database query
- Insert html after certain amount of posts?
- wp remove query
- Is there any need to use both wp_reset_postdata and wp_reset_query together?
- Show recent products first but “sold out last” in query
- Specific Loop For 2 Within Each
- Transient pagination not working properly
- WordPress creating excessive joins on meta_query with search
- How to display liked posts of current user in wordpress?
- post loop causes wp_users and wp_usermeta DB queries for each users
- Filter query posts by the count of metas for a meta key
- How to tell if $query_var isset?
- Show All Posts Insert Edit Link
- $wpdb->get_var not returning a result
- get_the_foo() in the loop – does it perform another query?
- If No Search Results, Show Posts from Alternate Search Query
- search through post-type attachments titles
- How to count get_users query?
- Date query year and month OR just year
- meta_query on a date range using an array of values
- cron job to auto delete posts of a specific post type older than x days
- Possible to get posts from multiple meta keys/values in a single query?
- Are database queries created using WordPress filters protected from SQL injection?