-
AuthorPosts
-
June 20, 2017 at 3:30 pm #810404
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,
MoniqueJune 20, 2017 at 3:58 pm #810430did 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; }June 20, 2017 at 4:17 pm #810450But! 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 !
June 20, 2017 at 6:33 pm #810568Hi,
Thank you for the input, Guenni!
Monique, please let us know if you need further help.
Best regards,
SarahJune 22, 2017 at 2:44 pm #811558Hi 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,
MoniqueJune 22, 2017 at 4:51 pm #811665Hi Monique. Will do. Thanks! :)
Cheers!
Sarah -
AuthorPosts
- The topic ‘Switch off sidebar for portfolio’ is closed to new replies.
