Home › Forums › Calendar Products › Events Calendar PRO › Custom page for displaying calendar
- This topic has 4 replies, 4 voices, and was last updated 9 years, 2 months ago by
Marc.
-
AuthorPosts
-
February 18, 2017 at 2:47 am #1240906
Marc
ParticipantHi there (sorry for my bad English),
I just installed Events Calendar Pro on a GeneratePress website. Everything works fine, but I have one question:
I have a page where the calendar is included via shortcode. This page has a special layout, defined by GeneratePress (only Sidebar-Content, my other pages have Sidebar-Content-Sidebar), so there’s enough space to display the calendar. There’s also some additional content on it, right under the included calendar.
Now I’d like to set up this page as the main calendar-page instead of the default, generated calendar-page. When I enter the slug of my custom calendar site at the calendar settings, it says that this slug is already in use (that’s right, because it is :-)).
Question: How can I define that Events Calendar Pro should use my own custom calendar page instead of the default calendar page?
Not sure if this is a Events Calender oder GeneratePress-topic, but it would be great if you could help me with this, because the relaunch deadline is right ahead 🙂
The page is currently not accessible for it is on a DEV-server… Hope my explanation will do it, though…
Thank you very much & cheers, @zan
February 18, 2017 at 8:11 am #1241031Marc
ParticipantSome tries later, I found out that the Events Calendar page uses the global sidebar settings for blog pages. When I change this to the desired sidebar-content layout, the Events Calendar page looks fine (without right sidebar).
But by changing this, the sidebar of course disappears on my blog pages as well, where it should be the 3 column layout sidebar-content-sidebar.
Now I found a hint in the GeneratePress documentation, how to target different pages with individual layouts, for example:
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 ( is_category() ) return 'no-sidebar'; // Or else, set the regular layout return $layout; }Question: How can I find out if we are on the calendar’s page? Knowing this, I could return the desired sidebar layout by adding a filter…
This would only be the second best solution, the best would still be to set up a custom page as the main calendar’s page, so I can specify the desired layout and additional content (header image and main content).
-
This reply was modified 9 years, 3 months ago by
Marc.
February 18, 2017 at 10:22 am #1241184Cliff
MemberHi, Marc.
If I’m understanding your current question, you could use is_post_type_archive() to detect if you’re on one of our calendar views, like this:
is_post_type_archive( Tribe__Events__Main::POSTTYPE )Before you try that though, you might want to try wp-admin > Events > Settings > Display tab > change the Events Template option and see if that helps without requiring custom code.
If you do need the custom code, there are other conditionals that you might wish to use, now or later, such as tribe_is_month(), tribe_is_list_view(), etc.
March 12, 2017 at 9:35 am #1253089Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
This reply was modified 9 years, 3 months ago by
-
AuthorPosts
- The topic ‘Custom page for displaying calendar’ is closed to new replies.
