Site logo

Archived topic

bbpress and Sidebars

3 replies · Started by Dominik Günder on October 14, 2015

Viewing posts 1–4 of 4

Hello Tom,

i encounter some strange issue regarding bbpress and the sidebar widgets in generatepress using the subtheme forefront.

I have set the widget sidebars to disappear for the forums mainpage here:
http://home.guender.net/forum/

But still both sidebars are displayed, what ever option i set in the generatepress page options. (Page option: Content (no sidebars)

If i do this on any other page it works just good. Is there any possibility to stop bbpress from overwriting this?

Best regards,
Dominik

Hi there,

WordPress treats bbPress (and other custom post types) as a blog, so the blog sidebar layout applies for bbPress.

To override this, you can use a function like this:

add_filter( 'generate_sidebar_layout','generate_custom_bbpress_sidebar_layout' );
function generate_custom_bbpress_sidebar_layout( $layout )
{
 	// If we are on a category, set the sidebar
 	if ( is_bbpress() )
 	 	return 'no-sidebar';

 	// Or else, set the regular layout
 	return $layout;

 }

Let me know if that helps or not :)

Worked perfectly! Thank you again for the great support - Even tho this was not a theme related issue :)

No problem! :) Glad we could get it working.

This archived topic is closed to new replies.