Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #663843

    Hi there,

    Please can you help me with some code to remove the sidebar on portfolio item pages by default?

    I’m using a child theme, so it would need to be in the child’s functions.php file.

    Many thanks
    Duncan

    #664858

    Hey Dunc,

    Copy single-portfolio.php to your child theme and remove:

    get_sidebar();
    

    Best regards,
    Josue

    #664904

    Thanks Josue; I’ve tried that but the sidebar still appears (please see the link below).

    Best regards
    Duncan

    #664908

    Hi,

    Can you please create me a WordPress administrator account? post it here as a private reply.

    Regards,
    Josue

    #664931

    Details below. It would be great if a future version of the Enfold theme could have separate dafault options for single posts and portfolio items in the sidebar settings!

    • This reply was modified 8 years, 4 months ago by Dunc R.
    #664962

    Hi,

    Ok let’s try a different way, try selecting no-sidebar for Sidebar on Single Post Entries, portfolio items inherit the settings of single post.

    Best regards,
    Josue

    #665224

    Hi Josue,

    Thanks. Yes, I understand that, but I need single post sidebars to be on by default and portfolio item sidebars to be off by default.

    Is there a filter/action that can be used in the functions file to recognise when a post is a portfolio item and turn the sidebar off?

    Best regards
    Duncan

    • This reply was modified 8 years, 4 months ago by Dunc R.
    #666048

    Hi,

    Please use this in the functions.php file:

    add_filter('avia_layout_filter', 'avia_change_post_layout', 10, 2);
    function avia_change_post_layout($layout, $post_id) {
        if( is_singular('portfolio') ) {
            $layout['current'] = $layout['fullsize'];
            $layout['current']['main'] = 'fullsize';
        }
    
        return $layout;
    }

    Best regards,
    Ismael

    #666098

    Perfect, thanks Ismael; that function has worked!

    Please can you log a new feature request…
    • A separate ‘default’ sidebar setting for Portfolio items in the main theme options.

    Thanks again
    Duncan

    #666226

    Hi!

    Please feel free to send us any requests at

    Thanks a lot

    Regards,
    Basilis

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.