I'm making a page for past events (using Event Expresso plugin) and I'm kinda confused about the wp_query.
This one works:
$atts = array(
'title' => NULL,
'limit' => 100,
'css_class' => NULL,
'show_expired' => true,
'month' => NULL,
'category_slug' => NULL,
'order_by' => 'event_start_date',
'sort' => 'DESC',
'date_query' => array(
array(
'column' => 'event_start_date',
'before' => '1 month ago',
),
),
);
However, this one won't work (it will still show event past May 11):
$atts = array(
'title' => NULL,
'limit' => 100,
'css_class' => NULL,
'show_expired' => true,
'month' => NULL,
'category_slug' => NULL,
'order_by' => 'event_start_date',
'sort' => 'DESC',
'date_query' => array(
array(
'column' => 'event_start_date',
'before' => '2020-05-11 23:59:59',
),
),
);
Is there something wrong with my code?
The column 'event_start_date' returns the event date when I do print_r($post->event_start_date); inside a post loop.
I'm really confused why the 2nd code does not work.
I also tried
'before' => 'now',
and
'before' => 'today',
and its not working. :(