I formed this query based on this answer.
I would appear this is no longer the way to do it… I reformatted the query to look like this:
query_posts(
array(
'post_type' => 'events',
'showposts' => -1,
'order' => 'ASC',
'orderby' => 'meta_value_num',
'meta_query' => array(
'relation' => 'OR',
array(
'key' => '_ecmb_datetime',
'value' => strtotime('today midnight'),
'compare' => '>='
),
array(
'key' => '_ecmb_datetime_end',
'value' => strtotime('today midnight'),
'compare' => '>='
)
)
)
);
Which seems to have solved the problem! If anyone has any other suggestions please feel free to share 🙂
Related Posts:
- meta_query with meta values as serialize arrays
- Use REGEXP in WP_Query meta_query key
- How to query posts based on lat-lng coordinate as post meta?
- Set Alias for meta_query arguments in get_posts()
- How to Compare Two Meta Fields
- Is it possible to orderby multiple meta_keys when using meta_value_num?
- Getting attachments by meta value
- Using custom meta_query with relation not working as expected
- WP_Query meta_query where meta value ends in space
- Nested query inside Logical operator OR not working in meta_query
- What is an efficient way to query based on post_meta?
- WP_Query not working as expected for attachments and custom meta_query
- How do I create my own nested meta_query using posts_where / posts_join?
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- How to order a post type with meta_value_num and if meta_value_num does not exist then order by date
- Exclude post on loop by multiple meta key value
- How to query ‘posts_per_page’ to display a different blog posts index template?
- Order By Multiple Meta Fields
- Advanced WP Query hogs the SQL server
- Order posts by meta value and Date
- Query sticky posts with thumbnails
- How to get user_id from wordpress database inside ajax function?
- WP_Query with multiple meta fields filter?
- How to combine meta_query and post__in in WP_Query
- How to orderby meta_value_num with dollar ($) sign
- Order a query result by a numeric meta key even if it does not exist, but put the posts with meta key first
- Single meta_query query using OR instead of AND in request’s WHERE statement
- Meta Query Array Error 500
- How to do meta_query for attachments?
- SQL: What is wrong with the following query (generated by WordPress WP_Query, ordering prices)
- Why isn’t my `meta_query` array functioning properly?
- Overwrite YoastSEO meta-tags with another page’s [closed]
- How to orderby multiple meta fields if some fields are empty
- Fetch Record based on meta key dates
- Suggestions on making this query/code more performant
- Order by meta value (numeric value lower to higher)
- Large AND OR query timing out
- WP_Query with different postmeta filter for each categories
- meta_query not working as expected
- Slow WP_Query with ‘OR’ on meta_query
- Query posts with “non set” meta value
- Query with meta_query and tax_query together not working properly
- Array as ‘key’ in WP_Query
- Ordering a mysql style datetime stamp with meta_query
- Is it possible to query a custom field where the value is between two fields?
- Filter posts by comparing custom meta value against postdate
- Wp_query with 2 meta keys and array of meta values
- meta_query: check if number exists
- Searching for meta_key returns 0 posts
- Event with multiple dates, display events chronologically
- meta_query fails to compare on values containing apostrophes
- Check if searched number is within the post meta value
- add_query_arg to compare and display events from a certain date
- WP Query / Meta Query [duplicate]
- Query posts by searching for a string in a meta field
- WP_Query not returning correct result with meta_query parameter
- Query multiple post types, but different order for each
- How to add date_query to meta_query array
- Order by the first array within a meta_query
- Query ACF relationship field – Comparator IN – Value array
- Query on meta values and post title
- Combine query in WP_User_Query()
- Multiple nested meta queries
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- How do i create a custom post query when the meta value is an array?
- How can I modify the query by adding to the existing query?
- Custom Meta Query doesn’t work the same on two site
- WP Query – grouping posts by same meta key, adding together values from another key
- How to do WP_User_Query for Nested Array value Inside Nested Array field
- Query for current post
- WordPress Query custom ordering by temporary variable
- Custom query to retrieve oldest post and retrieve others with date interval
- Comparing Meta Field date in WPQuery using Meta_Query?
- How to create better WP_Query to look for date time which is anywhere between two meta values?
- Very slow query generated getting meta data from posts
- How to filter on placeholder image
- Filtering WP_Query based on wp_postmeta keys values
- Slow wp_posts and wp_postmeta query using Advance Custom Fields
- Multiple meta_query not working
- compare for multiple meta values for same key in wp_query
- datetime picker, timestamps and meta queries
- WP_Query with meta_query won’t orderby
- meta_query only check if both value are set
- What is the best way to reset a search on a meta_key / meta_value?
- Slow query when selecting with large meta query or post__in
- WP Meta Query at depth 2
- Extending WP Query: Custom geolocation meta values work, but tax_query breaks
- Using custom field as ‘orderby’ value causing post grouping by publish date
- Is there any difference between below WP_Query code snippets?
- Set right order for query that returns posts based on two custom fields
- Meta_query weird behaviour
- Looking for a way to exclude frontpage and nav menu from query filter
- Creating Custom Query
- Get posts by meta value except one post [closed]
- WP_Query by meta key not returning any posts
- WordPress extremely slow when using get_posts with multiple meta_query relations
- Use meta query only 3 or more results?
- Use value from meta key array for use in WP_Query
- WordPress – Optimize the Meta Query for 3 meta keys at a time
- WP_Query filtering in ACF field containing dates