Full width calendar, sidebar with single events

Home Forums Calendar Products Events Calendar PRO Full width calendar, sidebar with single events

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #791244
    Vandeputte
    Participant

    Hi there, I would like my /events main calendar page to be full width, without the sidebar showing. However, it would be nice to have the sidebar showing with single events. I’ve found this topic on this, but I don’t know where to put the code. I’ve copied it in custom css and tried it in style.css, but it doesn’t seem to work. Can you help me?

    #792046
    Barry
    Member

    Hi!

    I’m not too sure which post/code you’re referring to, but one way to handle this is figure out where in your theme the sidebar is loaded and added a conditional statement to control when it runs.

    For example, let’s say your template includes this line:

    <?php get_sidebar() ?>

    You might change this to:

    <?php
    if ( ! tribe_is_event_query() || ( is_singular() && tribe_is_event() ) )
        get_sidebar()
    ?>

    This will allow the sidebar to be loaded either if the page is nothing to do with events, or, if it is a single event page.

    Would that help?

    #792162
    Vandeputte
    Participant

    Hi Barry, Thanks for getting back to me. The topic I was referring to is this one:

    Want Calendar to be wide, but events pages to have sidebar.


    I work with the Dutch translation, so I’m not sure if I translate back correctly, but I have my settings set at complete styles, which blends in just nicely with my theme. If I select for the events template the ‘default events template’, all event pages show up full width, without sidebar. If I change this to ‘default page template’, all event pages show up with the sidebar.
    I think your workaround should also work, but would you know where typically I would find that line <?php get_sidebar ( ) ?>?

    #792206
    Barry
    Member

    Hi!

    The topic I was referring to is this one:
    https://theeventscalendar.com/support/forums/topic/want-calendar-to-be-wide-but-events-pages-to-have-sidebar/

    Ah, I see. Yes well that would certainly hide the sidebar (it would still be sent to the browser, though, it just wouldn’t be visible) and you’d probably need to tweak it to match your own theme’s structure.

    I think your workaround should also work, but would you know where typically I would find that line <?php get_sidebar ( ) ?>?

    It depends on the theme – in Twenty Fourteen for instance you can find it in lots of different templates including page.php, index.php and single.php – similarly so for Twenty Thirteen.

    If I select for the events template the ‘default events template’, all event pages show up full width, without sidebar.

    So if you decide to use this template you’d effectively have to do things in reverse and add the sidebar rather than remove it. You might for instance add this code to your own custom version of the default events template (please see our Themer’s Guide for details on setting up template overrides):

    <?php if ( is_singular() ) get_sidebar() ?>

    This would typically go somewhere after get_header() but before get_footer() … some experimentation may be needed to get a good fit with your theme 🙂

    #824587
    Barry
    Member

    Hi! It’s been a while so I’m going to go ahead and close this thread. If we can help with anything else, though, please don’t hesitate to create new threads as needed. Thanks!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Full width calendar, sidebar with single events’ is closed to new replies.