Skip to:
Content
Pages
Categories
Search
Top
Bottom

How I removed the sidebar using CSS


  • Phill
    Participant

    @sharkbites

    I, like most people using BBpress, have had an issue removing the sidebar from my new BBpress forums. I tried editing template files, adding files into my theme’s root, commenting our sidebar commands and whatever else has been recommended on these forums. Not to say those don’t work – I just couldn’t figure them out which is most likely due to my complete lack of php knowledge. I’m posting this for those of you like me, who have no idea how to do those fancy things.

    Here’s how I removed my sidebar:

    First, I copied over the CSS folder from my BBpress plugin folder /bbp-theme-compat to my theme’s root folder. (From your server root it should be wp-content/plugins/bbpress/bbp-theme-compat/)

    Then, I found the CSS class my theme was using to design the main content of my wordpress blog (should be a style.css file in your theme’s folder). Mine happened to be #main_content. Next, I found the the sidebar CSS in my theme’s style.css file which was simply #sidebar.

    Note: I found the CSS class by right clicking the main content area of my website (where posts show) and selecting “Inspect Element”.

    After finding those I created BBpress specific classes and pasted those into the bbpress.css file now located at {you_theme’s_root}/CSS/bbpress.css.

    Here’s what I pasted in:

    .bbPress #sidebar { 
    width: 0px;
    display:none; }
    
    .bbPress #main-content { width: 940px; !important } 
    

    Most likely you won’t need the sidebar’s width attribute but I added it in just in case.

    And finally, after hours of trying to figure this out I went to my BBress forums page to discover that the forums fit perfectly into my theme without any sign of a sidebar.

    I hope this helps!

You must be logged in to reply to this topic.