Archived topic
Sidebar on Events Calendar pages (esp. Single Event View)
9 replies · Started by Terry on August 9, 2016
I can't seem to get the sidebar working on Events Calendar pages. I tried searching the forums, but the only post I saw that seemed somehow related discussed HIDING the sidebar. Since I can't see it in the first place, I'm pretty sure that's not the answer.
Any suggestions on how to fix this?
Many thanks!
Terry
Hi Terry,
This is the function you're looking for: https://generatepress.com/forums/topic/issues-with-the-events-calendar/#post-176870
You just replace "no-sidebar" with one of the other options: https://generatepress.com/knowledgebase/choosing-sidebar-layouts/ (at the bottom)
Hi Tom,
Thanks for your reply. I added this as a function using Code Snippets:
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 'left-sidebar';
// Or else, set the regular layout
return $layout;
}
The sidebar isn't appearing. Do I need to add a call to it into the default-template.php file? (I looked on Events Calendar forums and saw a reference to adding 'get_sidebar()' to it, but I don't quite understand where I'd have to put it if I do that.
This is a bit further complicated by the fact I'm using Sidebar Manager to create custom navigation sidebars. This link shows the sidebar I want:
and here is a link to one of the Events Calendar pages where I can't get it to show:
Single Events Listing - No Sidebar
I would appreciate any suggestions... Thanks, Tom!
Terry
It looks like the sidebar is there, there's just nothing in it.
In "Appearance > Widgets", is there anything in the left sidebar area?
No, there isn't... because I'm using Sidebar Manager to place different menus on different pages. So the menu I am trying to display shows in my widgets as "News & Events Menu". Here's the widget area:

and here's the Sidebar Manager setup:

Thanks, Tom!
Terry
Hmm, so it's probably an issue with that plugin + GP.
What if you try a plugin like: https://en-ca.wordpress.org/plugins/display-widgets/
With which plugin? Events Calendar? (The sidebar menus are working fine on all of the other pages.)
Do I maybe have to change the menu name to something different in the function I added to the code snippets?
Thanks, Tom - you rock. Hope you enjoy the 'cup of coffee'. You deserve it! :)
Terry
I was thinking it might be an incompatibility between GP + Events Manager + Sidebar Manager.
The function is working, as the sidebar HTML exists - it's just there's nothing in it.
What if you bypass the Sidebar Manager plugin just to test?
It did indeed work putting it in the left sidebar - thanks, Tom! (I hadn't done that because I thought it would show in the left sidebar of ALL the pages, but it seems to be grabbing the right menu as defined in the Ultimate Shortcodes widget... yay!)
I appreciate your help!
Terry
Glad I could help, and thanks for your donation! :)