Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Moving sidebar in Buddypress default theme from the right to the left

  • @nickharambee

    Participant

    I am trying to switch the sidebar in the default Buddypress theme in WordPress from the right to the left.

    The markup is essentially in the form:

    
    <div id="container">
    <div id="content"></div>
    <div id="sidebar"></div>
    </div>
    

    And I don’t want to mess with the markup if possible.

    I have a test page with markup in essentially the same form here (username:guest, password:stackoverflow), and the following CSS works:

    
    #container {
    float: left;
    width: 100%;
    }
    
    #content {
    margin-left: 230px;
    }
    
    #sidebar{
    float: left;
    width: 170px;
    margin-left: -100%;
    }
    

    However when I try this in my child theme of the Buddypress default theme it doesn’t work, as you can see on this page. The width of the content div exceeds the width of the container div and the sidebar overlaps the content div.

    Could someone advise as to the correct CSS to get the sidebar on the left and the content taking up the remaining space within the container DIV.

    Thanks,

    Nick

Viewing 9 replies - 1 through 9 (of 9 total)
  • @karmatosed

    Moderator

    You can take a slightly simplier approach:

    div#content {
    remove the margin-left, float it right and set a width of say 80% *you may have to adjust this to fit
    }
    div#sidebar{
    change to be a width % like 17% and float left, remove the margin left -100%
    }

    You will have to tweak this a little to work for yourself but this is a less restrictive approach and keeps some of the responsiveness of the default theme.

    @nickharambee

    Participant

    @karmatosed Thanks for this. It works well except that I’d like the sidebar to be a fixed width, and the content to be a variable width (up to the max width setting). Is there any way to adapt your method to work with a fixed width sidebar?

    @mercime

    Participant

    Check out the RTL stylesheet of bp-default which brings the sidebar to the left https://buddypress.trac.wordpress.org/browser/tags/1.5.6/bp-themes/bp-default/_inc/css/default-rtl.css

    @nickharambee

    Participant

    @mercime. Thanks, that sorted it nicely.

    @nickharambee

    Participant

    I spoke a little too soon. This works for every page except the ‘Tasks’ and ‘Projects’ sub menus on the To Do tab for the GTM plugin. On this view the the sidebar disappears and the content appears outside the container as you can see in this screenshot. Does anyone know what I can do to fix this? Thanks.

    @mercime

    Participant

    That screenshot requires username and password.

    On another note, I see that you’ve posted about similar “Tasks” issues even before the change of sidebar location at https://wordpress.org/support/topic/plugin-bp-gtm-system-strange-things-happening-with-task-list-view-in-wordpress-34?replies=1 so I can also suggest that you post this GTM issue at @slaffik ‘s forums at https://buddypress.org/community/groups/bp-gtm-system/forum/

    @nickharambee

    Participant

    @mercime Thanks, will do. The username for viewing the screenshot is ‘guest’ and the password is ‘stackoverflow’

    @nickharambee

    Participant

    @mercime Just to update, I have found that the issue with the ‘Tasks’ and ‘Projects’ view under ‘My Account/To Do’ is seen when using the Buddypress default theme as well as my child theme, so it would seem that this issue isn’t related to the CSS that I have used to move the sidebar to the left. Thanks again for your help with this.

    @flixya4gabby

    Participant

    @karmatosed. I saw your work at WPMUDEV; I mean how you helped a guy to resolve his buddypress sidebar issue. I was following the tutor but at a point I got hooked up. I thought of joining WPMUDEV immediately and ask you this question, but then again, I am not well equipped financially at the moment. Please if you help me solve this issue out, I will not forget about it so easily. Thanks. Now this is what I have done. FIrstly I added this code in my childtheme functions.php file.

    register_sidebars( 1,
    array(
    'id' => 'leftsidebar',
    'name' => 'Christlike-sidebar',
    'before_widget' => '<div id="%1$s">',
    'after_widget' => '</div>',
    'before_title' => '<h3 class="widgettitle">',
    'after_title' => '</h3>'
    )
    );

    Then I saved it and refreshed my browser in my widgets administration panel. Guess what the sidebar did appear. So I added some widgets into it and saved it. Then I created a new sidebar with a notepad in my child theme and named it Christlike-sidebar.php. Then I added this code into it.

    <div id="leftsidebar">
    </div>

    I learnt from numerous tutorials I read online that you have to add a code to your index.php file to enable the sidebar to appear in my site. I obeyed promptly and added this code:

    immediately below

    I saved everything and refreshed my browser. Damn… nothing appeared. I have read and read and read, searched out for how to do this on Google, Bing, and Yahoo but all my efforts have yielded nothing. Please help me out.

    Again, if there is any developer that knows how best I can achieve this, please help me out. Thanks alot to you all.

    Gabriel.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] Moving sidebar in Buddypress default theme from the right to the left’ is closed to new replies.
Skip to toolbar