Support » Alpha/Beta/RC » Admin bar CSS

  • Resolved esmi

    (@esmi)


    The Admin bar adds the following CSS to all front facing pages:

    body {
        padding-top: 28px !important;
    }

    This can severely disrupt any absolutely positioned elements on the page. A better approach might be to use:

    body {
        position: relative !important;
        top: 28px !important;
    }

    which (in theory) should preserve any existing positioning.

Viewing 13 replies - 16 through 28 (of 28 total)
  • Hey THANKS A LOT IPSTENU !!

    YES YOU’RE RIGHT !! BUT ….

    YES you’re right… i searched the code and the ID is wpadminbar so i applied a red border with solid style and 2 px and IT WORKED !! BUT …. i tryed to set a “fixed position” and it didn’t worked out !!!

    HOW CAN I SET THE ADMIN BAR TO THE BOTTOM APPLYGIN CSS ??? I think wordpress apply the position dinamically … so It’s just possible via JQUERY???? or HOW ??? Sorry I’m newbiew … and barely starting keeping up with jquery too jeje

    THANKS EVERY BODY !!!

    IT’S PRETTY WEIRD TOO

    BECAUSE i tried searching for the string “wpadminbar” in ALL WORDPRESS FILES (sending all files to my notepad++ – sometimes it really helps me) but THE STRING DOESN’t appeared !!

    NOTE:Now I don’t know if that’s because now I have too much files (because I working now with tortoise – the svn client ) and notepad++ just ignore many other files wich could have had that string

    Actually I just want to know how to globally edit the wp-admin css for a WordPress multisite. I recently activated Buddypress on the network and the admin bar it comes with is overlapping all my dashboards.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Plugin Review Team Rep

    astromono, same way, but put it in a plugin file in mu-plugins.

    I have a file called adminbar.php in my mu-plugins folder with this:

    <?php
    
    /*
    Plugin Name: Admin Bar
    Plugin URI:
    Description: Admin Bar stuff
    Version: 1.0
    Author: Ipstenu
    Author URI: http://www.ipstenu.org/
    */
    
    /* Stylesheet */
    function link_to_stylesheet() {
            ?>
    <style type="text/css">
    #wpadminbar .quicklinks a {font-weight:bold;}
    </style>
    <?php
    }
    add_action('wp_head', 'link_to_stylesheet');
    
    ?>

    Thank you very much for the reply, however I would like to know what’s the selector for the body in the wp-admin?

    That way i can just put in a “padding-top:25px;” on it and it’ll move the body down so that the admin bar is no longer overlapping anything.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Plugin Review Team Rep

    That made no sense to me for a moment until I realized you’re saying ‘On the ADMIN side of WordPress, the BUDDYBAR is overlapping dashboards.’

    Which it shouldn’t, since the buddybar’s not supposed to show on the admin side. Have you posted about this on buddypress.org?

    yup, I did, but got no answer. If you install WordPress Multisite you can run the Buddypress plugin as a network plugin, and it will replace the default WP Admin Bar both in the wp dashboard and the sites as well (depending on your settings.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Plugin Review Team Rep

    Yeah, sadly that’s gonna be a BuddyPress specific answer. I mean, I swapped mine out to only show the WP admin bar and it works fine.

    define( 'BP_USE_WP_ADMIN_BAR', true );

    From http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/bp1-2-8-and-the-wp-3-1-admin-bar/

    But … what you’re seeing is abnormal behavior and it’s on the BP side so you really need BP specific help :/

    @ipstenu

    Do you know how I could add facebook, twitter, and youtube buttons to the wordpress admin bar via the plugin you suggested:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Plugin Review Team Rep

    tarmentano – Add links like this: http://wp-snippets.com/addremove-wp-admin-bar-links/

    But if you need more help for that, make a NEW topic in http://wordpress.org/support/forum/how-to-and-troubleshooting 🙂 It’s not an alpha/beta question anymore.

    I have a post type/single page that I’m using to create iframes for embedding on other sites and blogs. The admin bar code is creating that extra 28px space at the top, and if I try to include it in a wordpress text widget, it screws with the existing admin bar on the hosting site for the iframe. I’m using a custom single and custom header file, wondering how I can lose the bar and everything associated with it entirely just for that content. Thanks!

    Here’s the quickest way I found to do it, from yoast:

    in functions:

    if ( isset($_GET['bar']) && 'no' == $_GET['bar'] )
    
       add_filter( 'show_admin_bar', '__return_false' );

    This would allow you to disable the WordPress admin bar by going to example.com/?bar=no, you can of course change those values.

    documentation:
    http://yoast.com/disable-wp-admin-bar/

    This will work for my purposes, if anyone has any alternate suggestions, I’d be interested.

Viewing 13 replies - 16 through 28 (of 28 total)
  • The topic ‘Admin bar CSS’ is closed to new replies.