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?
- Converting HTML Template to WordPress Theme
- Extending the WP_Widget_Text class
- mysql query from wordpress page using custom table
- Selectbox in admin panel function linking to CSS
- WordPress 3.2 query_posts and pagination, permalinks issue
- Can I install/embed WordPress on a ‘single page’?
- only show container with next/prev links if they exist?
- What query string parameter is available for index.php, that works for both pages and blog articles?
- ACF: how do I get the fields and its values of a specific group?
- How to check if a meta value has already been assigned to any user?
- How to hide products that do not have an image from a slider carousel for an ecommerce webpage?
- Customize Theme comment template to Insert VoteUp and VoteDown buttons
- filter default query to show just selected level of child pages in wordpress
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- Set WP_query ‘order’ option by another tables value
- Trying to build simple deposit code that hooks into woocommerce
- How to pick the default selected value in wordpress dropdown?
- WordPress default Search function inconsistent in WooCommerce Product Titles
- Add New User, extra fields which are required?
- user_profile_update_errors hook not executing
- Send an email to specific adress when button is clicked?
- Customizer: active_callback and sanitize_callback incompatibility?
- Saving and Restoring a Canvas on A Individual User Basis
- Redirect specific user role to specific site after login?
- Send multiple attachments with wp_mail in PHP
- WordPress admin pointers tour bug?
- Increase offset while looping
- custom url rewrite for wordpress
- Extend plugin Class through functions.php
- Long running queries
- wpdb php get_var query to get ID for URL image doesn’t work for ID over 999
- 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)
- Customize position of social icons in upme plugin [closed]
- How to pre populate a form field with a link of a current user’s author profile?
- Weird 404 URL Problem – domain name being placed at end of urls
- Two queries for a WP_User_Query search work perfectly apart, but not together
- Trying to get a PHP variable defined in a custom post into a javascript file. Null value. Using wp_localize_script
- How to get the value of input hidden html from text editor to custom page template?
- Make a list of sites for each user in WPMU – switch_to_blog (display in SITE_ID: 1)
- Menu jumping when calling it via PHP
- Output Video Download Link in template
- Modify custom field input data before creating a new post
- Output custom field value to post string
- Query if audio attachment AND/OR custom field
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Media Upload , file name changed automatically
- Replace shortcode in substring
- Custom posts in different columns style
- Need help enqueueing webfonts
- need help with existing code showing subpages
- register_taxonomy() take much queries
- How do I add a custom css to all posts without affecting homepage css? [closed]
- WordPress SQL injection
- how to show only specific category for a template
- Which is the correct way to conditionally enqueue a CSS file?
- Custom Background by Page IDs
- Pass argument to event hook
- Odd / Even posts add class minus first post
- Advanced Custom Fields not displaying
- How to get private property in parent class into extended class?
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- “operation successful” message
- unable to use ‘new WP_Query’ in AJAX call
- Exclude posts with specific metadata from search?
- Change order of custom submenu link in WP Admin?
- Underscore – Self hosted fonts
- Parse error: syntax error, unexpected ‘}’ on get_the_author_meta [closed]
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- Hook called before text widget save
- How to list commenters and days since last commented
- Add data-id attribute to child page links
- How to add div blocks after certain set of post
- How to overwrite orderby with add_query_var
- Can’t update multiple rows with $wpdb query
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Warning: Illegal string offset on theme options page [closed]
- Clickable image link sends people to wrong URL
- customize wordpress database error page
- Display Youtube Time Automate from Key
- Echo title attribute php
- working with term_relationships table
- How to fix this PHP warning in WP-Admin after upgrading to 3.1.2?
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- How to Configure Events List in WordPress to Disappear Event Once Date is Past
- Create page template via functions.php?
- str_replace with the_content is not working
- WordPress query undefined offset in loop
- Can I make get_users() query global?
- How to create a field in customize and show that in header.php?
- Where is the PHP code generating an element?
- Issue with custom loop in Archive page
- How to display SQL query that ran in WC_Order_Query?
- Basic wpdb update question