This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Show only Future Events

#44433
Ernest MarcinkoErnest Marcinko
Keymaster

It’s likely only the date format and the field. I checked to see and you seem to be using the Events Manager plugin, for that this should work:

add_filter("asp_query_args", "asp_query_args_apply_date", 10, 2);
function asp_query_args_apply_date($args, $search_id) {
	$args['post_meta_filter'][] = array(
		'key'     => '_event_start',
		'value'   => date('Y-m-d H:i:s'),
		'operator' => '>=',
		'allow_missing' => false
	);
	return $args;
}