Remove Sidebar From The Events Calendar

Hey, I am new here so please forgive me if I am asking something that has already been answered.

I am using the Tribes calendar and I want the sidebar from my site to be removed. I have gone through this post, but it doesnt work: Roots and Modern Tribe's Events Calendar

I have created the duplicate default-template.php but nothing happens.

I was having the same issue with woocommerce until I added “‘is_woocommerce’,” to the lib/config.php file and it removed it for woocommerce. Is there the same hack that I can use for the Tribes calendar. I just dont know what to script in: “‘is_tribes’ (???),” I hope someone can help :smile:

Thanks for any feedback that you can give me.

look at Full Width Posts.
I am not familiar with the tribes calendar, but the solution should be similar.

Add these to your lib/config.php first array for sidebars to rule them out:

array('is_singular', 'tribe_events'),
array('get_post_type', array('tribe_events'))
1 Like

This works, but unfortunately, it removes the sidebar from every other page as well? Functions as if is_page were added to the array.

I have the same problem and I have to delete roots and develop a new theme by myself. Plz help us because I really like Roots.

Hi guys !

I just tried :
array(
‘is_404’,
‘is_front_page’,
‘tribe_is_upcoming’
),
And It works now.
Just take a look at https://gist.github.com/jo-snips/2415009 for your functions u wanna detect.

Hi, I’m also trying to get the sidebar removed from all of Event Calendar pages using:

array(‘is_singular’, ‘tribe_events’),
array(‘get_post_type’, array(‘tribe_events’))

However, it also removes sidebars from all other singular pages such as on the blog page.

What may have changed since 2014?

Furthermore, the filtering is not working as expected either:

add_filter(‘sage/display_sidebar’, NAMESPACE . ‘\sage_sidebar_on_special_page’);

function sage_sidebar_on_special_page($sidebar) {
if (array(‘is_singular’, ‘tribe_is_event’)) {
return false;
}
return $sidebar;
}

Not sure about the rest of your issue, but this conditional will always return true, and therefore your function will always return false:

if (array(‘is_singular’, ‘tribe_is_event’)) 

You’re creating an array and then (effectively) casting it to a boolean, which will always be true because it exists.

I’m guessing you probably want a conditional more like this:

if (is_singular() || tribe_is_event())
2 Likes

Also, based on Modern Tribes conditional events, the following also removes the sidebar but does so on other post pages as well:

array ( tribe_is_event() && is_single() )

Thank you for the response. The condition you posted also removes it from all post type pages.

Because you need to pass the post types you want to is_singular().

https://codex.wordpress.org/Function_Reference/is_singular explains how to use it.

is_singular(['name_of_post_type'])

You’re also posting code with fancy quotes and the filter you’re using isn’t calling the function correctly. It’s NAMESPACE . '\\function_name — note the two \\'s, not one…

3 Likes

If you provide this as a conditional, i.e. if (array ( tribe_is_event() && is_single() )) it will always return true because you’re passing an array as a boolean, which will always return true.

In theory, this conditional should return true on individual calendar events and calendar event archives:

if (tribe_is_event() || is_post_type_archive('tribe_events'))
2 Likes

Ben, thanks for the clarification. That works perfectly… my apologies but it’s not very clear in the docs or perhaps I’m an idiot.

Also, in the docs you only have one \

Link please

20 chars

Now I feel stupid agian… but I copied the above directly from the page and didn’t remove that back slash.

Anyways, thanks again.