Unable to sort wp_query by date/time with multiple meta_key s
Just an idea: you could save your time values in an array and then sort it with PHP. Example: $keys = array(‘opening_time’, ‘film_time’, ‘artist_talk_time’); $times = array(); $custom_field_keys = get_post_custom_keys(); foreach ($custom_field_keys as $custom_field_key) { if (in_array($custom_field_key, $keys) { $custom_field_value = get_post_meta($post->ID, $custom_field_key, true); if ($custom_field_value >= $thedate && $custom_field_value <= $future) { $counttest++; $times[$custom_field_key] … Read more