I think that you have poor data design. The solution, in my opinion, is to alter how your data is saved. If you saved all of your dates under the same key name you could run a relatively simple query to get the next date.
$args = array(
'meta_query' => array(
'relation' => 'OR',
array(
'key' => 'event_dates',
'value' => date("Y-m-d H:i:s",strtotime('today midnight')), // set
'compare' => '>',
'type' => 'DATE'
),
),
'posts_per_page' => 30,
'post_type' => 'performances'
);
$loop = new WP_Query( $args );
var_dump($loop->request);
Related Posts:
- Multiple choice in a custom taxonomy
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- How can I check that the acf field value is not a duplicate when adding a post?
- Check if values exists DB
- How can I add more code to this?
- Cleaning up WordPress to improve performance?
- List of all theme customizer control types?
- Show the most popular post per week
- Add a class to links in the visual editor (how to get old dialog back)
- How to remove hardcoded characters from playlists?
- Creating custom Woocommerce attribute taxonomies from a plugin
- Load post content into iframe
- wp_customize_image_control default value
- How to order posts by modified date without using ‘query_posts’?
- Specific Loop For 2 Within Each
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- Is it recommended to pass some data to scripts in `wp_enqueue_scripts`?
- WP database error for comments_popup_link()
- Overriding a theme redux file in child theme
- Widgets not showing in my custom theme
- How to display custom field on homepage
- Get ID of child from child slug, while knowing parent ID
- List User order by ID in Descending order (Backend)
- How to get 2 or multiple custom post types in wordpress functions.php
- Creating bulk posts with Youtube videos
- Change the site tagline (or similar) based on current page
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- Create WP_Query to search for posts by their categories or their parent/child categories
- ACF: how do I get the fields and its values of a specific group?
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- Set WP_query ‘order’ option by another tables value
- How to pick the default selected value in wordpress dropdown?
- WordPress default Search function inconsistent in WooCommerce Product Titles
- How to add a do_action on refreshing of WP customizer?
- Function to delete a post, it’s children and it’s grand children (half way there already)
- Weird 404 URL Problem – domain name being placed at end of urls
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- WordPress SQL injection
- Which is the correct way to conditionally enqueue a CSS file?
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- Hook called before text widget save
- How to list commenters and days since last commented
- How to overwrite orderby with add_query_var
- Can’t update multiple rows with $wpdb query
- Echo title attribute php
- How to Configure Events List in WordPress to Disappear Event Once Date is Past
- str_replace with the_content is not working
- How to display SQL query that ran in WC_Order_Query?
- Custom Post type slider with thumbnail navigation
- Ajax search shows all results when user empties input?
- List post by title length
- Need help with pagination
- Querying for specific tags
- Limit tags shown in post
- Why my query does not run with prepare
- Undefined variable: row?
- Editor capabilities – admin_init
- WP insert post Redirect after function has executed
- WordPress is removing query variables like page, p from the URL of a custom static page
- Create condition for Author bio Social Links
- How can I add diffrent editable text fields?
- Build A Custom SQL Query for WordPress Search
- WordPress Custom Form – Getting Query Vars, Weird Glitch?
- Woocommerce template file outputting tags
- Featured image in menu wordpres
- Trying to update Woocommerce meta values
- Display articles with a different template in the home page | Solved |
- Reading URL Parameters
- Category Page Displaying all Pages
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- How can I update the price when someone enters postcode or zip code in woocommerce checkout page?
- Create “blank” admin page without having admin-bar/admin-menu for faster load
- Need help transforming echo to return for use with shortcode
- Noob question: want to remove the “site identity” logo for specific part of website only
- Create Schema in WordPress with PHP
- Redirect after login depending on the URL
- wordpress query returning unexpected results
- Real time notification on user profile after new comment
- How to do a MySql query in WordPress?
- How to add text before posts
- Pagination in WP Queries
- Add two or multiple functions in WordPress Post or Page
- How can I display a query in a page?
- WordPress error on my website
- Unserializeing multiple column values that are stored in one database results variable
- Best way to define a database with product codes and back-end support?
- wp_customize_image_control default value
- If Elseif Query
- Widget header unique classes
- why is this content-template not showing any of my blog-entries?
- How to get the count for each taxonomy term
- How to add button to top of theme customizer?
- Save Option on Database
- Edit the Publish Widget Options
- Does wp_query and query_posts affect website performance? [duplicate]
- New to WordPress & Freelancing [closed]
- Add multiple HTML attributes to an Elementor button
- Sorting a custom post type in pre_get_posts
- SQL query to retrieve the number of WordPress posts with all given categories