I want to display a forum specific sidebar on all bbp pages. For this I include the desired widgets in design > widgets > Forum. The sidebar is correctly shown on many bbpress pages, but not all. For example the forum index page and the bbpress profile page (‘/forum/user-base/username/’) does not have the sidebar.
How can I have the sidebar (named ‘Forum’) display on those pages as well? I am looking for a little php function which I can include in the child theme functions.php. I am using the Enfold theme which generally seems to work very well with bbpress.
I had the same problem when I was experimenting with buddypress (I decided to not use buddypress though). To have the sidebar displayed on all buddypress pages we came up with the following working function:
//custom forum sidebar on buddypress pages
add_filter('avf_custom_sidebar','avf_custom_sidebar_mod');
function avf_custom_sidebar_mod($sidebar) {
if ( bp_current_component() ) {
$sidebar = "Forum";
}
return $sidebar;
}
Can this function be adjusted to work with bbpress? I thought maybe just change the if condition to if ( bbp_loaded() ). But it does not seem to work.
Any help would be greatly appreciated. Best regards, peter