Home › Forums › Calendar Products › Events Calendar PRO › Calendar Templates / Grid View Header & Footer
- This topic has 18 replies, 5 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
November 17, 2011 at 12:44 pm #11235
Dokuchie Rob
ParticipantI 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?
November 17, 2011 at 7:09 pm #11246Rob
MemberSomething along those lines should be doable. Let me see if Jonah, our dev, has any suggestions.
November 18, 2011 at 6:57 am #11258Dokuchie Rob
ParticipantThis 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.
November 18, 2011 at 7:26 am #11260Dokuchie Rob
ParticipantI might also mention that changing to the calendar page template and editing that is NOT working either.
November 18, 2011 at 7:28 am #11261Dokuchie Rob
ParticipantDAMNIT! Scratch that last comment, but not the previous two.
I REALLY need an ‘is grid view’ template tag.
November 18, 2011 at 10:05 am #11267Rob
MemberI’ve got Jonah looking at this today.
November 18, 2011 at 12:12 pm #11286Jonah
ParticipantHi 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,
JonahNovember 21, 2011 at 9:15 am #11343Dokuchie Rob
ParticipantSomething 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?
November 21, 2011 at 9:16 am #11344Dokuchie Rob
ParticipantThis was meant to be above:
if( !is_page(‘events’) ) { get_sidebar(); }
November 21, 2011 at 10:36 am #11347Rob
MemberHey Rob. Jonah will take another look at this today.
November 21, 2011 at 7:00 pm #11399Jonah
ParticipantHi Rob,
You can use:
if(tribe_is_month()) {
//do something
}
Which will return true in grid view.
I hope that helps,
JonahJanuary 5, 2012 at 2:50 am #12881nakturnal
ParticipantHi 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!
January 5, 2012 at 8:26 am #12889Jonah
ParticipantHi 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.
January 5, 2012 at 8:34 am #12897Rob
MemberHi 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.
January 5, 2012 at 10:19 am #12910nakturnal
ParticipantHi 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!
-
AuthorPosts
- The topic ‘Calendar Templates / Grid View Header & Footer’ is closed to new replies.
