Tagged: sidebar, widget area
Hi there,
I’m using Events Manager Pro and the sidebar on Event Category pages is empty. The Event Category pages are using page.php as template.
I have made multiple custom widget areas in WordPress. Now I want to call one of them if the page is a Event Manager Category Page. I want to use something like this:
if (em_is_category_page() ) {
// Display all widget in widget area called "Agenda"
}
How do I do this?
Hey Alcadis!
I’m not sure if this is what you want but edit page.php, find this code:
//get the sidebar
$avia_config['currently_viewing'] = 'page';
get_sidebar();
Replace it with this:
//get the sidebar
$avia_config['currently_viewing'] = 'page';
if (!em_is_category_page() ) {
get_sidebar();
} else {
echo '<aside class="sidebar sidebar_right smartphones_sidebar_active three alpha units" role="complementary" itemscope="itemscope" itemtype="http://schema.org/WPSideBar"><div class="inner_sidebar extralight-border">';
dynamic_sidebar( 'Agenda' );
echo '</div></aside>';
}
Regards,
Ismael
Thanks a lot!
This is exactly what I needed. Problem is solved now.