[Resolved] Tribe Events Calendar without Sidebar

Home Forums Support [Resolved] Tribe Events Calendar without Sidebar

Home Forums Support Tribe Events Calendar without Sidebar

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #217559
    Louis

    Hi Tom,

    I happen to see that post https://generatepress.com/forums/topic/sidebar-on-events-calendar-pages-esp-single-event-view/
    and I always wanted to display Tribe Events Calendar with no-sidebar (but this is not a page I can mofify). So I try the code you propose:

    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;
    
     }

    That works fine for the main page (Calendar): No-sidebar πŸ™‚
    But for Single-Event page the Sidebar is there but no widget are shown.
    My Calendar URL is http://lelaurier.net/calendrier/
    The Single-Event URL are http://lelaurier.net/evenement/single-post-name/
    (Snippet is not activated presently)
    Any way to remove the Sidebar on the Calendar page and keep the Sidebar and Widgets on the Single-Event page?

    Thanks

    #217567
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    I believe the single event sidebars can be altered using the metabox: https://generatepress.com/knowledgebase/choosing-sidebar-layouts/#metabox

    Let me know πŸ™‚

    #217672
    Louis

    Hi tom,

    You said “I believe the single event sidebars can be altered using the metabox”. Yes, that is true, but it is the main calendar page that I do not have acces to “modifiy page”.

    What I want to do is remove the Sidebar on the Calendar (Main Tribe Events page) and keep the Sidebar and Widgets on the Single-Event page. In using the code above, it does work on all Tribe Events pages (With the particularity that on Single-Event page it does leave the Sidebar but there is no widget shown).

    I did leave the Snippet activated for you to see.
    Main page (Fine): http://lelaurier.net/calendrier/
    Single-Page (Sidebar but no widget) : http://lelaurier.net/evenement/journee-de-golf-des-couples-club-de-golf-de-beloeil-le-14-aout/

    #217696
    Tom
    Lead Developer
    Lead Developer

    Hmm, that’s interesting. If you remove the function above, do widgets show on on your single event pages?

    #217714
    Louis

    Sure same widgets show on the Single-Event pages and on Calendar pages.

    #217741
    Louis

    Hi Tom,

    Found a way to do what I wanted (No-sidebar on Calendar pages): if ( tribe_is_event_query() && (! is_singular()) )

    BTW, only if ( tribe_is_event_query() ) does remove the sidebar on both Calendar pages and Single-Event pages.

    Thanks again for your help.

    #217782
    Tom
    Lead Developer
    Lead Developer

    Ah, glad you found the solution! πŸ™‚

    #610203
    Mohammed

    Hello,

    I’m not a coder (just a designer) and wish to add a snippet that hides the sidebar on both the calendar view and single view…a go full-width on the views of course (no blank space on the side).

    What would be the code and where should I add it please?

    Thanks

    Mo

    #610327
    Leo
    Staff
    Customer Support

    Hi there,

    Can you try this:

    add_filter( 'generate_sidebar_layout','tu_custom_category_sidebar_layout' );
    function tu_custom_category_sidebar_layout( $layout )
    {
     	// If we are on a category, set the sidebar
     	if ( tribe_is_event_query() && ! is_singular() )
     	 	return 'no-sidebar';
    
     	// Or else, set the regular layout
     	return $layout;
    
    }

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    #610430
    Mohammed

    Hi Leo,

    I did add the code through the plugin you mentioned.

    Worked like a charm on the full calendar view πŸ™‚ but not on the single that still has a sidebar.

    Any idea on how to delete this one too?

    Thanks for your support.

    Mo

    #610437
    Mohammed

    Me again for some unknown reason I did change some of the parameters of the plugins and now I got the fullwidth view for the single too.

    Thank you again πŸ™‚

    #610847
    Leo
    Staff
    Customer Support

    Glad I could help πŸ™‚

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.