BP Scholar Admin Bar Layout issue in 1.2.7

Hi Folks (particularly Tammy...you'll probably fix this in a jiff :slight_smile:

This issue occurred after updating to BP Scholar 1.2.7. I know this is a seemingly small issue, but it affects the layout on every page.

Current Platform - WordPress 3.0.4 and BuddyPress 1.2.7.

Issue exists in both Firefox 3.6.13 & IE8.

I have included some screenshots below to help illustrate.

Though the issue appears to relate to the 'body' padding at 'Line 1' of .adminbar.css', there appears to be something else at play which I cannot find.

Ever since I have been using BP Scholar (from 2.1.6), I have had an 'adminbar.css' file set-up in my child-theme folder. This custom file only altered the abovementioned 'Line 1' code from 'padding - 25' to 'padding - 0'. It has worked perfectly until now.

The child-theme file is no longer working as it is being over-ridden by the main theme file.

The problem is that when I do edit the 'adminbar.css' file to remove the padding, it overlays the login-bar when I login. This did not use to happen. This issue occurs in both the frontend and the dashboard. Although it seemed ok in the dashboard for a while (the cache was emptied beforehand).

I have tried all the usual measures - emptying cache, turning plugins off etc.

I do hope you are able to assist...and thanks in advance.

Cheers

Stephen G

PS I really like the new 'Dashboard' link in the Adminbar Menu. Thanks. :stuck_out_tongue:

Screenshots:

  • DavidM

    Hi there train4lifewpmu,

    I spent quite a bit of time working through this one myself and I apologize for not having responded to it sooner. I believe the problem has to do with the top-padding being in a parent of the adminbar in the CSS.

    Basically, we need to check if the user is logged into Wordpress and if not, then we should set the top-padding to 0px. I see no viable way of doing this except through PHP. If we put that PHP in the theme's functions.php, then it will only affect the main site and sub-sites would still display the padding at the top. We could safely put the code in a plugin, but that would require creating a plugin, which I thought was just too much for this simple case.

    I'm hoping the resident experts might have a working solution, which will likely be simpler than my line of thinking. :slight_smile:

    Cheers,
    David

  • train4lifewpmu

    G'day David :stuck_out_tongue:

    No apologies necessary. I only posted this yesterday...I reckon that's a pretty good response time for a non-critical issue :slight_smile:

    And I very much appreciate your helpful response.

    I agree. I don't think 25px of top-padding should require a plugin... :slight_smile:

    I don't think it is an issue with other my user blogs...the BP Scholar theme is only used on our main site. So long as the adminbar still appears on the other blogs (which it does), there is no conflict caused with log-in bars due to the removal of the 25px padding.

    Being a BuddyPress issue would explain whiy I have not had this problem before. However, for 25px of padding, I'm not about to wade through the BuddyPress code to find the problem. Though it is interesting that the 'adminbar.css' is no longer working in the Child Theme Folder. Perhaps Tammy will be able to work some magic in upcoming theme releases. For now, I'll just suck-it up and get used to my new top-border. :stuck_out_tongue: Could be worse ey? :stuck_out_tongue:

    Thanks again David.

    Cheers

    Stephen G

    PS Re: "let me know how I do" - doin' great mate! :stuck_out_tongue: I'm heartened to see that the team has listened to some of us more grumpy members and started a dedicated support team. Though there are exceptions, we all know that written/verbal communication with 'humans' is not generally a strong suite in the world of programmers :stuck_out_tongue: Hopefully this will free them up to do what they do best and improve members' experience. So far so good :slight_smile:

  • DavidM

    Hey train4lifewpmu,

    If you wouldn't mind giving this a try, I believe it ought to work just perfectly given your circumstance. I've tried it out on my own site and it works like a charm. Frankly, I can't believe I didn't think of it earlier.

    If you could just open the theme editor, navigate to the functions.php file and add in the following...

    if (is_user_logged_in()) {echo '<style type="text/css">body {padding-top:25px !important;}</style>';}
    else {echo '<style type="text/css">body {padding-top:0px !important;}</style>';}

    ...right toward the top of that file so that it looks like this...

    <?php

    define('TEMPLATE_DOMAIN', 'bp-scholar');
    if (is_user_logged_in()) {echo '<style type="text/css">body {padding-top:25px !important;}</style>';}
    else {echo '<style type="text/css">body {padding-top:0px !important;}</style>';}

    I believe your site will work exactly the way you want it to.

    My first attempt only fixed the issue on the main site, but then it removed the padding so that sub-sites would still display that empty padded area. This solution works with both the main site and the sub-sites as well and in my test, everything looked just peachy like it's supposed to.

    Please let me know if that works out okay for you or if it needs further clarification. :slight_smile:

    Cheers,
    David

  • Tammie

    There is no need for that switch code it's serious overkill and not required. First up all our themes do cater for the gap it's built in. You should also never add to functions.php. Please do not do that train4lifewpmu.

    We use adminbar.css just like any other BuddyPress theme - it's not persistant throughout at all the default theme for instance has it built in. Also in my testing I can't recreate. Anyone got exact steps be happy to look if have them. I tested in the following situation:

    1. WIthout BuddyPress - sub blog
    2. Without BuddyPress - main blog
    3. Logged in and out

    Also never use !important unless it's a last resort in code that's not good at all to use it's basically breaking the 'cascading' part of CSS which is the one of it's foundation points.

    Getting back to your issue though on your site. Lets get a link and I can take a look. Have you made sure you both have no other javascript errors on your pages?

    If it doesn't work in our themes across all testing and please report to me David if you can recreate at will with steps - we will adjust themes. We should never ask you to add code into functions.php like that.

  • DavidM

    Hello tammie,

    You're completely right and I did mean to mention this is a dirty hack but it fixed the issuefor myself. And as I said, this is not a BP Scholar nor a WPMUDev theme issue at all, but a Buddypress admin bar issue and is prevalent even in the default Buddypress theme.

    Basically, there's not a problem at all if the admin bar is set to always be visible. The problem only ever arises when the Buddypress > General settings > "Hide admin bar for logged out users?:" option is set to "Yes".

    Like I said, the hack is a dirty hack and it would be removed upon any update, but I was hoping it would work as a temporary fix only until a more feasible means were established.

    Thanks,
    David

  • Tammie

    I think what is best would be for you to add in the code that worked before you upgraded to the child theme - assuming it still does.

    Hack or not that isn't something we should be doing David so my advice is to go with pure CSS in the child theme. Dirty hacks aren't really time savers for anyone in the long run :slight_smile:

    However, I will note a word of caution here. Admin menus are coming into WordPress and BuddyPress also will have elements of this that may effect our themes. As a result of this we will review in our final 3.1 testing with 1.2.8 BuddyPress and assess.

    This is only an issue currently if at all it will probably resolve as a result of the new admin bars but that remains to be seen.

  • train4lifewpmu

    H Guys,

    Thanks for your great assistance.

    My apologies for the delayed response. It's an 'other side of the planet thang'. :slight_smile:

    I haven't done anything yet. I'll leave it as is for now so that Tammie can have a look. The URL: http://train4life.com.au.

    As for your Dirty Hack David, I love it. :slight_smile: As Tammie pointed out, this issue may be resolved in up-coming updates. And though I agree with Tammie's long-haul reasons, in my case, given that the BP Scholar Child Theme has worked so well to date, I reckon I can handle one dirty hack until the next update. I'll give it a whirl when Tammie has had a look. :stuck_out_tongue:

    Oh! And I have no reported errors in my Server Logs and no Java Script Errors reported via the console.

    Thanks again.

    Cheers

    Stephen G

    PS Re: recreating the issue - I don't know how to either, as it only appeared following the updates.

    PPSS Also, I have deactivated the 'adminbar.css' file in my child theme, to help simplify.

  • Tammie

    train4lifewpmu: I strongly advise as the theme designer against that hack you can even put that code in your header.php or other files maybe even a proper function - we can explore but not with a hack in place. It should never go in functions.php - don't underestimate the power of one dirty hack to cause other issues you may not be aware of when innocently put on. Also !important doesn't work in all plugin cases.

    Think of it this way: you have another issue 'crops up' you've also done lots of other things to your setup. We spend hours with you working through things to find it's the use of !important or the fact that functions.php is called not just on theme front... wouldn't that be a shame to go through all that due to just putting a few lines of code in to short cut that hasn't been tested in all cases :slight_frown:

    These are the things we need to consider when supporting you - we don't want to cause issues by anything we suggest.

    Have you tried adding to the child theme again? That's what I really need to know and see.

    Have you tried uncommenting and using the child css?

    child theme > style.css:
    /* Uncomment the following line to use child adminbar.css but only if have BuddyPress installed */
    /* @import url( _inc/css/adminbar.css ); */

    Then adjusting in there?

  • train4lifewpmu

    Hi Tammie

    Thanks for your further assistance.

    Oki doki. Will take your advice. I haven't used the hack and won't.

    What do you mean by - "Have you tried adding to the child theme again?"?

    I tried uncommenting the line you mentioned in the child theme 'style.css'. No change.

    As this is not a life and death functional issue, I'm happy to wait for further updates.

    Thanks again.

    Stephen G

  • train4lifewpmu

    Hi Tammie,

    Yep!

    In the same manner that I had originally in the child-theme...since the updates, this 'css' code alteration only has an effect if I alter it in the parent theme 'adminbar.css'.

    This is the change - Line 02 only:

    body {
    padding-top: 0;
    }

    All other child-theme stuff works just fine after the abovementioned updates. This is the only one that didn't.

    Cheers

    Stephen G

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.