Archived topic
Page Template without sidebar for bbpress.php ?
3 replies · Started by Jordan on March 13, 2018
Hello,
This is a very nice theme -- thanks for creating it. The premium version has been very nice to work with so far.
I am looking for the simplest and cleanest way to remove the sidebar on all bbpress pages so that all bbpress content shows up in a full width window without any sidebar content. The goal is that all bbpress pages should display with the same appearance that results when the "Content (no sidebars)" option is selected in the GP theme > Edit Page> Layout > Sidebars section of the admin for a single page. Is there a single page template in the theme (that doesn't load any sidebars) that I can simply copy over to a child theme, and rename bbpress.php to accomplish this ?
If not, is there another simple solution for this? I am already using a child theme and the snippets plugin but I want to achieve this as cleanly as possible.
Thanks!
Hi there,
This should help: https://generatepress.com/forums/topic/sidebarcontent-for-woocommerce-bbpress/#post-243673
Thanks so I modified the code suggested and it seems to do the trick.
add_filter( 'generate_sidebar_layout','tu_custom_bbpress_sidebar_layout' );
function tu_custom_bbpress_sidebar_layout( $layout )
{
// If we are on a bbpress page, set the sidebar
if ( function_exists( 'is_bbpress' ) && is_bbpress() )
return 'no-sidebar';
// Or else, set the regular layout
return $layout;
}
Can this code be further modified to set the header for all bbpress pages as well?
Not sure what you mean by set the header?