Skip to:
Content
Pages
Categories
Search
Top
Bottom

Prevent Admin Bar from interfering with themes

  • I’m looking for a way to prevent the admin bar from interfering with WP themes on sub blogs. I know of at least one theme that has content that gets pushed down and misaligned because of the admin bar.
    I have 100+ themes so it wouldn’t be simple to go through and check/mod each theme.
    Is there anyway i could mod the Admin Bar so that it doesn’t interfere with whatever theme is active?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Anyone have any ideas? I have at least two sites now that are effected by this.


    Boris
    Participant

    @travel-junkie

    Hmm, you could use bp-custom.php to add a global stylesheet that fixes the CSS issues.

    I wouldn’t know how to modify the CSS to fix the issue.

    Anyone have any ideas on how I could fix this so that if the admin bar is visible it pushes the site down the right amount and if it isn’t it doesn’t?


    @mercime
    Keymaster

    @mercime

    The simple fact is that you need the common hook, “, in footer.php of all your themes so that the bp admin bar will show up in user blogs in the same manner — inserting the bp admin bar at top of screen and pushing down the layout in the right amount.

    There will be a couple or so themes where it won’t look the same because of style done on body/wrapper area. When that happens, ask WP.org forums or here to help you out with the CSS of that specific theme. Or, you can install the Firebug add-on for Mozilla and work on the style for those themes yourself.

    Well that doesn’t help, because the CSS for a theme will need to be different when the bar is there and when it isn’t. If i have to use CSS to push a theme down so it looks right then it’s going to leave a gap when the bar is missing.


    @mercime
    Keymaster

    @mercime

    @fjrichman if you import the adminbar.css from the bp-default theme into your theme’s style.css, there won’t be any gap if you disable the BP Admin Barl , The bp-admin-bar.css you imported takes care of adding the necessary space at the top when you enable bp admin bar. When you disable bp admin bar, your theme will go back to original setting without extraneous gap.


    beholdcreative
    Member

    @beholdcreative

    fjrichman… I agree this is a problem. It would be one thing if BuddyPress only added the padding when the site visitor was logged in, but it’s poor form to add 25px pixels padding to the body regardless. I understand that it would be a problem for WordPress developers who don’t call body_class(), but, by default, the BuddyPress default stylesheet (adminbar.css) should specify its padding on body.logged-in, not on the generic body tag. In any case, that’s the easiest solution I know of. Just modify adminbar.css (most likely at /wp-content/plugins/buddypress/bp-themes/bp-default/_inc/css/adminbar.css) on the first line to body.logged-in. If for some reason you have themes that don’t or can’t call body_class(), you can use the is_user_logged_in function to override the BuddyPress styling. Something like: `body#mypage { padding: 0px; } `. Hope that helps, two months later.

    Looking back at your question, I see that you were actually asking more generally to start about BuddyPress tweaking a design wether or not the user is logged in. Well, in that case it would be harder to have a one-size-fits-all solution. Sorry if I missed the thrust of your question, but this may be helpful to others.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Prevent Admin Bar from interfering with themes’ is closed to new replies.
Skip to toolbar