Hide recurring event instances of The Events Calendar plugin

Content Views Pro helps you to show events of The Events Calendar plugin easily.
To show only non-recurring events, and the first (parent) event from a series of recurring events, please add this code to file functions.php in the theme’s folder (or install this plugin Code Snippets then add this code to the “Code” textarea):

// Content Views Pro - Hide recurring event instances of The Events Calendar plugin
add_filter( 'pt_cv_query_parameters', 'cvp_theme_hide_recurring_the_events_calendar', 100, 1 );
function cvp_theme_hide_recurring_the_events_calendar( $args ) {
	if ( in_array( 'tribe_events', (array) $args['post_type'] ) ) {
		$args[ 'post_parent' ] = 0;
	}
	return $args;
}

Best regards,

Scroll to Top