Hi Abhinav,
Not sure about what you are asking here? An event will be considered ‘past event’ when the EndTime has passed. To tweak this you’ll need to alter the events query. While we cannot support this type of customization I’ll leave a snippet here that might help you getting started:
add_filter('tribe_events_pre_get_posts', 'filter_tribe_all_occurences', 100);
function filter_tribe_all_occurences ($wp_query) {
if ( !is_admin() ) {
$new_meta = array();
$today = new DateTime();
// Join with existing meta_query
if(is_array($wp_query->meta_query)) {
$new_meta = $wp_query->meta_query;
}
// Add new meta_query
$new_meta[] = array(
'key' => '_EventStartDate',
'type' => 'DATETIME',
'compare' => '<=',
'value' => $today->format('Y-m-d H:i:s')
);
$wp_query->set( 'meta_query', $new_meta );
}
return $wp_query;
}
Just add it to your theme’s function.php file and again, this is unsupported and you might need to tweak this a bit to work.
Best,
Nico
Thanks for The support Nico.
But my site is http://thebelasco.com/ and it is based on los angeles.
What i facing is that, either there are some couple of hours for the event . it shows the event as a past event.
Warm Regards,
Abhinav
Hey Abhinav,
Thanks for following up!
I think I may be understanding what you’re describing here. To clarify, you have events that are showing up as past on a given date even though they may be happening later in that day?
As an initial step, have you tried checking the timezone on your WordPress installation? It could be that it is set to a different timezone and that time is passing prior to the event occurring in California.
Let me know if this helps.
Thanks!