Hi there,
How can I switch off the sidebar for all portfolios at once?
I know this can be done in each portfolio > layout > sidebar settings. However, for easy maintenance it would be preferred to switch it off completely like for pages and posts through theme options > sidebar settings.
Please advise.
Thanks & regards,
Monique
did you work with child-theme than there was a little snippet for functions.php:
add_filter('avia_layout_filter', 'avia_layout_filter_mod', 10, 2);
function avia_layout_filter_mod($layout, $post_id) {
if( is_singular('portfolio') ) {
$layout['current'] = $layout['fullsize'];
$layout['current']['main'] = 'fullsize';
}
return $layout;
}
But! this will turn absolutely every portfolio to that layout – even if you are setting on editor a different layout.
you can exclude some post id by:
add_filter('avia_layout_filter', 'avia_layout_filter_mod', 10, 2);
function avia_layout_filter_mod($layout, $post_id) {
if( is_singular('portfolio') && !is_single(28986) ) {
$layout['current'] = $layout['fullsize'];
$layout['current']['main'] = 'fullsize';
}
return $layout;
}
you see here that portfolio with post id 28986 is not influenced – and than the settings will take place you had choosen on editor !
Hi,
Thank you for the input, Guenni!
Monique, please let us know if you need further help.
Best regards,
Sarah
Hi Guenni007,
Yes, that works! Thanks a lot!
Hi Sarah,
On this topic I have no futher questions. Maybe a suggestion only for a new feature: to be able to switch off sidebars for portfolio through theme options > sidebar settings? And yes, I know where I can request for a new feature :-)
Can you please flag this topic as closed?
Regards,
Monique
Hi Monique. Will do. Thanks! :)
Cheers!
Sarah