after migrating my website to siteground I don't know why my event page doesn't work properly. My past event list and future list are messed up. All list report all events future and past.
My code for future events is:
if (
$post->post_type=='page' &&
(
$post->post_name=='eventi' ||
$post->post_name=='events'
)
) {
$events = new WP_Query(
array(
'post_type' => 'tribe_events',
'posts_per_page' => -1,
)
);
}
and code for past event is:
$past_events = new WP_Query(
array(
'posts_per_page'=>-1,
'eventDisplay'=>'past',
'post_type' => 'tribe_events'
)
);
I tried a lot but I can't figure it out. Any help is appreciated, thanks.
eventDisplay
isn't (necessarily) recognized byWP_Query
, as it's an argument added by the plugin. Consider usingtribe_get_events()
instead (developer docs here.)