Hello! I’m working on a query where I have a few conditions, one of them involving post\_date. However, whenever I try to write my query the post\_date it doesn’t return any matches. If I comment that part out, it will return matches (but not quite to where I need). Is anyone able to help point me in the right direction?
$date_seven = date(‘Y-m-d H:i:s’, strtotime(‘-7 days’));
‘meta_query’ => array(
‘relation’ => ‘AND’,
// show posts where location is US
array(
‘key’ => ‘monitor_settings_location’,
‘value’ => ‘”US”‘,
‘compare’ => ‘LIKE’
),
array(
‘relation’ => ‘OR’,
// if end date is empty, show for 7 days after publish date
array(
‘relation’ => ‘AND’,
array(
‘key’ => ‘monitor_settings_end_date’,
‘value’ => ”,
),
array(
‘key’ => ‘post_date’,
‘value’ => $date_seven,
‘compare’ => ‘>=’,
)
),
// if end date exists, show until that date
array(
‘key’ => ‘monitor_settings_end_date’,
‘value’ => $date_now,
‘compare’ => ‘>=’
)
)
)
