Creating a Forum Specific Sidebar on BB Press & Styling of Forum pages

Hello support team,

I am using BB Press and would like to add a custom sidebar to the forum and change the styling of the pages.

I would like to add a custom sidebar to this page:

as well as all the other forum pages, but the pages do not show up under pages.

How would I add a custom sidebar to only the BB Press forum?

I would also like to change the styling of the BB Press forum to match more of the style of this page:

So I would like to remove the container and move the content of the page farther over to the left.

I can’t seem to find anywhere to put the CSS for this. So I assume it would be in the child theme?

Thanks for the help!

Hi,

1 ) Adding Custom Sidebar

Regretfully this isn’t a feature offered by X. It could be possible with custom development, but this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this.

2 ) Remove Container

You can add this in theme Options > CSS

.bbpress .entry-wrap  {
    background-color: transparent;
    box-shadow: none;
    padding:0;
}

Hey Paul thanks for the reply

  1. Sorry if I wasn’t clear. I would like to add a bbpress specific sidebar
    I have read the documentation on how to do so here:

https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#26-creating-a-bbpress-specific-sidebar

but was unable to get it to work.

When you follow this address to the forum page that I created, I can use the custom bbpress sidebar that i had created.

When I go into the “Welcome To The SoundShock Forum”, the default sidebar appears and this “Welcome To The SoundShock Forum” page does not show up under pages in the wordpress dashboard

Plugins didn’t work as I needed a specific page to show the bb press widgets on and I can’t find those pages as they do not appear in pages of the wordpress dashboard

The other way was adding code to your child theme and I was unable to locate the sidebar.php. I am not sure which sidebar.php file I was to add the second part of code.

2 . I have added the code

.bbpress .entry-wrap {
background-color: transparent;
box-shadow: none;
padding:0;
}

to theme options > CSS and the code does not seem to work

Thanks again for your help paul!

Hi,

Upon checking, I can see you have syntax error in your css code

Please change

/forum pages for bbpress tansparent/

with this

/* forum pages for bbpress tansparent */

With regards to your sidebar, you can try adding this in your child theme’s functions.php file.

function assign_bbpress_sidebar($sidebar){
  if ( x_is_bbpress() ){
    return 'ups-sidebar-forum';
  }
  return $sidebar;
}
add_filter( 'ups_sidebar', 'assign_bbpress_sidebar');

Hope that helps.

  1. Thank you for pointing out the error. It now works.

  2. I created the menue “bbpress sidebar,” added a couple of widgets, and added the code to the child theme’s functions.php and nothing seems to be happening. Are there any other steps I need to take to get the code to work?

I have added the code you sent by itself and with the code that is highlighted in blue as well in the functions.php and it is still not working.

Hello There,

Thanks for updating in! You will have to update the code and use this:

function assign_bbpress_sidebar($sidebar){
  if ( x_is_bbpress() ){
    return 'bbp-sidebar';
  }
  return $sidebar;
}
add_filter( 'ups_sidebar', 'assign_bbpress_sidebar');

And please do not forget to add widgets to the newly created BBPress sidebar widget area in Appearance > Widgets.

Please let us know how it goes.

I have added the

function assign_bbpress_sidebar($sidebar){
if ( x_is_bbpress() ){
return ‘bbp-sidebar’;
}
return $sidebar;
}
add_filter( ‘ups_sidebar’, ‘assign_bbpress_sidebar’);

to the functions.php file in the child theme and nothing seems to be happening and no new sidebar was created.

Is there anything else I should be doing?

Hi there,

The code is implemented to your X child theme and your active theme is Pro. And that code will not work, please install a Pro child theme and implement it there.

And please don’t remove any code from your child theme’s functions.php especially this line

add_filter( 'x_enqueue_parent_stylesheet', '__return_true' );

Thanks!

Ohhh wow, I did not even notice this obvious error.

Thank you for pointing this out Rad.

I have installed the pro theme, added the code, and everything seems to be working now.

Thank you all for your help!

Hey There,

You’re most welcome! We are just glad we were able to help you out.

Happy Holidays!

Thank you! And Happy Holidays!

You’re welcome and Happy new year!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.