Hide Recurring Events from Foreach – Tribe Events Calendar

Use ‘eventDisplay’ => ‘list’ in conjunction with the WordPress backend Settings for Tribe Events Calendar to prevent recurring events from showing up in custom loops.

Custom Loop:

$events = tribe_get_events( array(
	'post_type' => 'tribe_events', 
	'posts_per_page' => 4,
	'start_date' => current_time( 'Y-m-d' ),
	'eventDisplay' => 'list',
) );

Settings:

You can hide all recurring events from the front end using the “Recurring event instances” option.

Tribe Events Calendar - General Settings screenshot

Note: this will only show the first instance of the repeating event on the front end

Alternatively, you can hide the Event completely using Event Options: Hide from Event Listings within individual recurring events

Tribe Events Calendar - Event Options dialogue box

Note: this will hide all instances of the repeating event unless they are split into separate Posts.

Sourced here.

Leave a Reply

katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.