Hide Sidebar on GeneratePress Theme Using The Events Calendar Plugin

, , , , ,

The following code snippet, when applied to your GeneratePress child theme’s “functions.php” file, will hide the sidebar on the Tribe Events Calendar WordPress Plugin Events Page.


Hide GeneratePress Sidebar


** Hides GeneratePress sidebar on Tribe Events Calendar Plugin event page.
add_filter( 'generate_sidebar_layout', 'generate_custom_events_sidebar_layout' );
function generate_custom_events_sidebar_layout( $layout )
    // If we are on a tribe events page, set the sidebar
    if ( 'tribe_events' == get_post_type() || is_post_type_archive( 'tribe_events' ) )
        return 'no-sidebar';
        // Or else, set the regular layout
        return $layout;


If this article was helpful please take a moment to like us on Facebook, share this on your social media or buy us a cup of coffee.