Remove Sidebar for the Events Calendar plugin

This is a Developer Level doc.

If you're unfamiliar with PHP and/or editing files, codes and templates, as well as with resolving possible conflict, please seek help from a professional. Under our Support Policy, we don't provide support for modifications and customization.

 * Remove the sidebar in all Events Calendar pages
 * @return full-width, full-screen
function remove_sidebar_events_calendar( $class ) {

	if ( tribe_is_event()
		|| tribe_is_view()
		|| tribe_is_list_view()
		|| tribe_is_event_category()
		|| tribe_is_in_main_loop()
		|| tribe_is_day()
		|| tribe_is_month()
		|| is_singular( 'tribe_events' ) ) {
		$class = 'full-width';

	// Return correct class
	return $class;

add_filter( 'ocean_post_layout_class', 'remove_sidebar_events_calendar', 20 );

All PHP snippets should be added via a child theme's functions.php file.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.