Using OR relation in meta_query to check for a value before sorting by another

I think this might be part of the problem in your past query (the second one) array( ‘key’ => ‘end_date’, ‘compare’ => ‘BETWEEN’, ‘type’ => ‘NUMERIC’, ‘value’ => array($past, $now), ), You’re using BETWEEN but I think something like < would be what you want. You don’t want to show events that have ended between … Read more