I have a WP_Query function that uses these arguments:
$args = array(
'post_type' => 'exhibit',
'post_status' => 'publish',
'meta_query' => array(
'relation' => 'AND',
'date_clause' => array(
'key' => 'exhibit_end_date',
'value' => strtotime('tomorrow'),
'compare' => '>='
),
'location_clause' => array(
'key' => 'exhibit_location'
)
),
'orderby' => 'location_clause'
);
The idea is to display exhibits whose end date is less than tomorrow's date. The values are stored as unix timestamps. For some reason, exhibits are disappearing from my list the day before they are supposed to. For example, I have an exhibit whose last day is today, August 24, and its unixtime value is 1535068800. The value for tomorrow, August 25, is 1535155200. The latter value is clearly greater than the former, and so this exhibit should still be included in the query, but it is not.
What am I missing here?
date_clause
andlocation_clause
syntax before, and I can find no record of it in any of the docs, are you using a custom query modification plugin of some sort? They are definitely not standard WP core options, and aren't listed in the WP_Query documentationpre_get_posts
so that all events regardless of publish date are shown, rather than just those in the past