I can’t find anything about this but I’m trying to have a sidebar ONLY for blog posts and blog categories. Right now if I use custom posts or categories for anything other than blog posts then they ether show everywhere or nowhere. Is there a simple way to do this?
Thanks
Hey asthyanax,
Could you provide us with a link to the site in question so that we can take a closer look please? Note that you can select to show a sidebar or not in the Layout menu to the right on the edit page or each page.
Regards,
Rikard
It’s not online yet. I know I can select the sidebar per page but I’m also using custom post types and I don’t want sidebars on those categories for example. If you tell me there’s a way I can chose which category can have a sidebar or not I’d love that :)
Hi,
Set the layout of the category pages with the avia_layout_filter. Example:
add_filter('avia_layout_filter', 'avia_change_post_layout', 10, 2);
function avia_change_post_layout($layout, $post_id) {
if(is_tax('product_cat'))
{
$layout['current'] = $layout["sidebar_right"];
$layout['current']['main'] = "sidebar_right";
}
return $layout;
}
You can also use is_category in place of the is_tax conditional function.
Best regards,
Ismael