Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #433201

    I have the sidebar turned ON for Single Post Entries. I want the sidebar to show on my single blog posts. But I don’t want it to show on my single portfolio entries. I also don’t want to have to turn the sidebar off individually for all the sidebar entries.

    How can I edit single-portfolio.php to remove the sidebar? I’m sure I can use css to hide it but there must be a better way.

    #433790

    Hey hmsvictory!

    The best way would be to use the option when editing the portfolio post. There may come a time where you decide you want a sidebar on one post only and then you would have to redo a bunch of changes.

    Best regards,
    Elliott

    #433792

    I appreciate the reply but that is something I already know myself – I can’t consider that support.

    I have no problem customizing the template files – what do I need to do to make it impossible for single-portfolio.php to have a sidebar?

    #433958

    Hi!

    Add this in the functions.php file if you want the portfolio to have no sidebar:

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

    Best regards,
    Ismael

    #434299

    Thanks Ismael, this made the sidebar disappear on the portfolio pages.

    The <main> is still .av-content-small instead of .avi-content-full, so the content are is not the proper width. I am using the default template files.

    #434581

    I’ve been playing with single-portfiolio.php and none of the changes are affecting the Single Portfolios. Just adding a test phrase like “hello” within the code does not show up on the site. Is it possible that single-portfolio.php is not controling the display of single portfolio items on the website?

    Modifying the single-portfolio.php in my child theme folder to look like this has no effect on what is displayed on the single portfolios.

    #434602

    Hey!

    It’s not working because you’re using the advance layout builder to create the portfolio items. Remove the modifications then replace the code in functions.php with this:

    add_filter('avia_layout_filter', 'avia_change_portfolio_layout', 10, 2);
    function avia_change_portfolio_layout($layout, $post_id){
    	if(is_singular('portfolio')) {	
    	$layout['current']['content'] = "av-content-full";
        $layout['current']['main'] = "fullsize";
    	}
        return $layout;
    }

    Regards,
    Ismael

    #434604

    Boom. That works.

    Many thanks for the help. Now back to playing with some custom post types & Enfold :)

    #434976

    Hey!

    Great, glad we could help :)

    Best regards,
    Rikard

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