I need to get posts pertaining to a given category, AND : - have the event_start_date (custom field) greater or equal than today's date - OR have a event_end date (custom field) greater or equal than today (if their event_start_date date is less than today's date The results need to be order using the custom_start field. I'm working on this code, but I cannot find the relevant documentation for this specific usecase. Can you help, either pointing me to a good online explanation, or explain me how to fix my query? $since = date('Y-m-d'); $args = array( 'category_name' => 'private', 'post_type' => 'post', 'post_status' => 'publish', 'order' => 'ASC', 'meta_key' => 'event_date_start_id', 'orderby' => 'meta_value', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'event_date_start_id', 'value' => $since, 'type' => 'numeric', 'compare' => '>=' ), array( 'key' => 'event_date_end_id', 'value' => $since, 'type' => 'numeric', 'compare' => '>=' ) ) ); $query = new WP_Query( $args );