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?
- WP_Query vs get_posts
- Remove the Homepage Query
- simple sql query on wp_postmeta very slow
- How to Use Wildcards in $wpdb Queries Using $wpdb->get_results & $wpdb->prepare?
- wordpress query – orderby child post date
- Compare two numeric custom fields
- Custom query filter not working on woocommerce category page
- How to delete a transient on post/page publish?
- Transient not working for custom loops
- How to extract all ID variables from a query string?
- WordPress creating excessive joins on meta_query with search
- How to display liked posts of current user in wordpress?
- How to tell if $query_var isset?
- If No Search Results, Show Posts from Alternate Search Query
- Remove Unnecessary Mysql Query
- Grouping related postmeta data via SQL query
- Does meta_query work within get_posts array?
- Slow meta_query with about 4 milion record on wp_postmeta
- How to show more than 5 posts?
- WordPress Find Duplicate Post By Content
- WP Query Sort by meta value (date)
- mySQL query. ORDER BY meta_key
- how to query multiple categories in wordpress?
- Disable the MySQL query in the main query
- Strange string in console from wpdb query
- Update slug (URL) of pending posts via phpMyAdmin
- How can I get the query that would be run for the archive page?
- Query metas (and not : query posts by metas)
- Select query for a login
- What’s wrong with my $wpdb prepare?
- pre_get_posts : ‘post__not_in’ doesn’t work with global variable
- where should I reset query after using get_results?
- Query last updated posts (posts updated in the last 24 hours)
- Exclude featured image and custom field from this get_attachment query
- wpdb print all post meta
- Form and custom query problem
- Export Specific User data without plugin
- How to write: $wpdb->update having WHERE NOT value pair in the array
- Exclude all sticky posts front page twenty twelve
- Include current post into loop
- wpdb COALESCE won’t work
- Loop inside query
- get csv of users with user_meta
- Custom SQL Query passing array to WHERE p.id
- Query does not return content
- WordPress query undefined offset in loop
- Issue with custom loop in Archive page
- Query posts dynamic date range
- Parse query filter in wordpress and relation
- Waypoints + infinite scroll with custom query
- get posts by tag to showing in a widget
- Mysql query not working on WordPress 4.2.2
- get_post_meta with WP_query
- List WordPress Post and Related Attachments outside of a post page
- How properly create a blog template for wordpress?
- Is there a way to add a link directly into this media query?
- Problem on displaying the results on my query
- Improve performance of slow query
- WordPress search in modified post title
- meta_query not working
- Cannot get sql request from Query object?
- WordPress query: merge meta key (number) values and sort
- Heavy meta query causing SQL crash
- Question about of query
- Is there any way to get all custom posts and all custom terms with it’s meta in few queries?
- Modify behaviour of “s” parameter in wp_query
- Speed up search query that searches in post meta?
- How to make MySQL search queries with quotes
- Limiting a filtered query
- Alternative layout the loop
- Ordering Posts by parent category, name ascending
- Show posts by tags excluding current post
- Advanced Post Display/Pagination/Ordering
- Archive query not working correctly
- Custom MySQL Query for Post and Post Meta
- How to fix pagination for custom loops?
- meta_query dates from an array
- Displaying popular posts
- Pagination not working with custom loop
- How to have more post in a page than in your home page
- Detecting top parent category fails on home page
- Find all posts via SQL beginning with A of type B
- learn to run wpdb class
- Display old posts if no future posts exist
- Access Tables with number prefix
- how to add a read more button to my blog page?
- Can’t See Media Queries with Inspect Tool [closed]
- How to add multiple values with add_query_arg?
- Query parsing only author ids
- 3 queries to update WordPress
- How do I troubleshoot Maximum execution time of 60 seconds exceeded in updating a Media File?
- Woocommerce set loop_shop_columns to be 3 in the main shop page loop only and 4 otherwise
- update $wpdb one query
- Admin Post List table Query filtering “WHERE” for custom post type
- Ascending & descending posts on same page with IF statement
- Prevent executing query for wp_global_styles
- How to use a dynamic term id for the query block
- Meta Query compare with LIKE pulls similar post types: 55 and 155, and 1,155
- Query Loop Block: possible to restrict just child pages?