Calendar Templates / Grid View Header & Footer

Home Forums Calendar Products Events Calendar PRO Calendar Templates / Grid View Header & Footer

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #11235
    Dokuchie Rob
    Participant

    I need to know how to make the WordPress template header and footer display/hide in ANY of the events calendar pages.

    I want to be able to do something like:

    if( !is_grid_view() ) { get_sidebar(); }

    How come the Events calendar templates do not call the header and footer files?

    #11246
    Rob
    Member

    Something along those lines should be doable. Let me see if Jonah, our dev, has any suggestions.

    #11258
    Dokuchie Rob
    Participant

    This is actually pretty critical right now. It’s the only thing that’s stopping me from releasing a website for more than a few thousand dollars.

    #11260
    Dokuchie Rob
    Participant

    I might also mention that changing to the calendar page template and editing that is NOT working either.

    #11261
    Dokuchie Rob
    Participant

    DAMNIT! Scratch that last comment, but not the previous two.

    I REALLY need an ‘is grid view’ template tag.

    #11267
    Rob
    Member

    I’ve got Jonah looking at this today.

    #11286
    Jonah
    Participant

    Hi Rob,

    The Events Calendar runs within page.php and single.php so the header and footer are called like they are throughout your entire site.

    You’ll want to find where get_header() and get_footer() are called in your template (these are what loads the header and footer) and and use some conditional code to check for your events page, for ex.:

    if(is_page('my-events-page-slug')) {
    //don't show the header/footer
    } else {
    //show the header/footer
    }

    or for single events:

    if('tribe_events' == get_post_type()) && is_single()) {
    //don't show the header/footer
    } else {
    //show the header/footer
    }

    It’s a bit more complicated than this though because get_header() calls header.php which contains a bunch of stuff you’ll actually want to still use… Same with get_footer() which calls footer.php.

    You could also hide elements on certain pages with CSS depending on whether or not you have classes added to your body tag for different pages but we do not add those by default so you would have to figure out how to add them for your theme.

    Hopefully that helps.

    Regards,
    Jonah

    #11343
    Dokuchie Rob
    Participant

    Something is not going right here and not working.

    The URL is: http://www.oddtest.com/firefly/events/

    I’m trying to hide the sidebar, and have tried a bunch of conditional statements in header.php like:

    I need a conditional statement that I can use in the header and footer template files which returns true/false when I’m viewing the calendar. I can’t use a conditional that returns only the function call to retrieve the header and footer, and I can’t use CSS to hide the elements either, as this site template is almost all built and I’d have to reconfigure a bunch of stuff.

    I’m REALLY hoping a calendar as good as this wasn’t built without basic functions like ‘is_calendar()’, ‘is_single_event()’, ‘is_grid_view’ etc?

    #11344
    Dokuchie Rob
    Participant

    This was meant to be above:

    if( !is_page(‘events’) ) { get_sidebar(); }

    #11347
    Rob
    Member

    Hey Rob. Jonah will take another look at this today.

    #11399
    Jonah
    Participant

    Hi Rob,

    You can use:


    if(tribe_is_month()) {
    //do something
    }

    Which will return true in grid view.

    I hope that helps,
    Jonah

    #12881
    nakturnal
    Participant

    Hi there, I was just trying to add a specific class to the body of the page for the calendar and list views so I can display a sidebar on one and not the other. This is what I added to the functions.php but it doesn’t seem to register that it is on the gridview page at all:

    if(tribe_is_month()) {
    add_filter('body_class','grid_class_change');
    function grid_class_change($classes) {
    $classes[] = 'calendar-grid-page';
    return $classes;
    }}

    Any assistance would be much appreciated! Thanks!

    #12889
    Jonah
    Participant

    Hi naktural, are you sure that is the filter you can use with your theme? What theme are you using? This works specifically for me in Genesis.

    #12897
    Rob
    Member

    Hi nakturnal. Thanks for the note; sorry to hear that you’re having issues here. Let me see if Jonah can identify what’s up here…though it’d be helpful to have a link to your site as well, if possible.

    #12910
    nakturnal
    Participant

    Hi guys, thanks for the quick response!

    Jonah, it’s the same site that I had sent you access to (www.nakyouout.com) – the theme is a Twenty Ten Child theme. I’m no wiz at PHP but I found this code on WP’s documentation section and tried adding the If statement. The weird thing is that the filter works without the statement but it adds the class to every page. Then with the If statement nothing happens, even on the gridview page. Any advice would be appreciated! Thanks again!

Viewing 15 posts - 1 through 15 (of 19 total)
  • The topic ‘Calendar Templates / Grid View Header & Footer’ is closed to new replies.