Have you tried this?
'meta_query' => array(
'relation' => 'AND',
array(
'relation' => 'OR',
array(
'key' => 'start_date', /// or 'end_date' for cpt 'group_of_events??
'compare' => 'BETWEEN',
'type' => 'DATE',
'value' => array($filter_start_date, $filter_end_date),
),
array(
'key' => 'end_date', /// or 'end_date' for cpt 'group_of_events??
'compare' => 'BETWEEN',
'type' => 'DATE',
'value' => array($filter_start_date, $filter_end_date),
),
),
array(
'key' => 'type',
'compare' => 'IN',
'value' => $filter_type,
),
),
then you can change the start_date of the events to another key.
Related Posts:
- Using get_posts vs. WP_Query
- Way to include posts both with & without certain meta_key in args for wp_query?
- How to Access Global $multipage or Global $numpages outside the loop?
- How can I use WP-CLI commands without –allow-root
- Merging a complex query with post_rewind and splitting posts into two columns
- ‘posts_where’ filter not applying ‘WP_Query’ in `wp_ajax`
- meta_query not working properly
- Get all posts without tags
- Filter wp_query to search post title in function
- Two queries on the same page with pagination
- Using tax_query reverses my post_type argument in a custom WP_Query
- Best approach to create Hot and Trending sections
- creating wp query with posts with specific category
- $wp_query->current_post restarts from zero on paged pages
- get complex results set according to category structure
- Setup of taxonomy term template pages
- Ignore post by meta value in the main query
- Display posts in 3 days chunk
- how to get the id for a post from within a post and return post meta for it
- WP_Query’s “request” SQL Query
- How to do a query on custom taxonomies that is uncategorised?
- Order taxonomy terms in alphabetical order
- is_search was called incorrectly
- Empty tax_query array returns an empty array
- How do I sort posts with multiple pages
- Sorting By Custom Posts With Attachments
- How to choose between hooking into per_get_posts or into parse_query
- Woocommerce returns Product post_status as published even tho it is in status draft
- How to set pagination to work with ‘/page/’?
- How to do meta_query for attachments?
- How can I fix: “Notice: Undefined offset: 0”?
- SQL: What is wrong with the following query (generated by WordPress WP_Query, ordering prices)
- Order By table field comment_status in WordPress > 4.0
- Most commented last 24h, week, month, year and all time – posts_where
- WP_Query Pagination on multiple-loop page breaks WP or doesn’t show up
- Why isn’t my `meta_query` array functioning properly?
- Using hook to use DISTINCT in a wp_query
- How to duplicate 5 posts out of WP_Query results?
- Import wp users via one click demo option
- WP_query sorting can’t sort danish letters (æ, ø, å)
- Dynamic User Id
- Slow queries on a huge database
- Multisite pagination issue by multi query archive 404
- get_post_meta slowing down my page load (in a plugin)
- Hide elements outside loop based on query
- WP Query crashes on more than ~ 2000 posts
- different for loop if screen resolution < 1000px
- Pagination is not working with custom query inside a homepage template
- sort and display posts by custom field (wp-query and the loop))
- Issues with search after added meta_query
- How to load a script code only in posts?
- Woocommerce: order posts by meta key
- Modify query posts
- query post by author gender
- How do I add an item to the WP admin menu?
- Multiple meta query from array
- Find only those galleries with images
- WQ Query post meta date comparison
- Filter subpages in while loop from WP Query object
- Reciving Error 404 blog/page/2/
- WP Query Order By Multiple Values
- Error: Attempt to read property “ID” on null
- Unrelated post showing in WP_Query
- Custom meta_query order for Elementor based on post meta key [closed]
- wordpress pagination wont render on custom page template even though its right under the loop like the documentation says so
- How to combine meta_query and date_query with condition in WordPress
- ElasticPress is (aparently) messing with my search filters
- show related articles in single.php template
- WP_Query showing all posts, except from category X, unless it’s also in Y
- How to query search only for post titles?
- Shortcode attributes causes 500 error after updating the page
- WP Query. Ordering posts by another post types meta
- Show posts by category – category ID not working
- WP_Query to Retrieve Posts from WooCommerce Products that are Only in Catalog
- Get top 5 posts viewed using post_views_count
- Search Filter With Custom Taxonomy and Custom Fields : How do I handle it via plugin?
- query_posts based on a meta_key
- Track write actions to the database
- wp_query – show pages that have parent defined
- previous_posts_link not working in WordPress pagination
- Eliminate typical pages on search page, turn it into ajax search with “infinite” sized single page
- The sorting of posts by a meta_query with two keys fails while separated as single queries it works
- Display First posts without the default featured image
- Hierarchical List Pages as a table
- WP_Query with several meta_query-statements and order by meta_value
- paginate_links() with Custom Taxonomy
- Parsing External Table Arguments
- query_posts, oderby meta_value & print “future” posts
- Second wp_query doesn’t appear to be working
- Query posts by meta value and sort by another meta key
- Output ACF field dynamicaly within a taxonomy loop [closed]
- Why does WP_Query not search for two ‘meta_query’ keys separated with OR?
- How do I split a large query with a semi-expensive function included into multiple smaller queries
- Custom WP_query in Jnews theme returns thousands of posts
- wp_query loop with compare operator simply not working, why?
- taxonomy-{term}.php terms pagination returning 404 after a certain page
- Using WP Query, I want to include all posts in category 1 as long as they are not also in category 2
- Prevent URL Parameter Affecting other WP Query
- Sort by multiple columns using get_posts
- WP_Query filter Posts by timestamp event (range start and end) and by month (next 12 month)