Tagged: ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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,
    Monique

    #810430

    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;
    }
    #810450

    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 !

    #810568

    Hi,

    Thank you for the input, Guenni!

    Monique, please let us know if you need further help.
    Best regards,
    Sarah

    #811558

    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

    #811665

    Hi Monique. Will do. Thanks! :)

    Cheers!
    Sarah

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Switch off sidebar for portfolio’ is closed to new replies.