WordPress.org

Ready to get started?Download WordPress

Forums

Stick Admin Bar To Bottom
Stick Admin Bar To Bottom (22 posts)

  1. Larry Overton
    Member
    Posted 3 years ago #

    While the plugin works as it says, it leaves a black void at the top. It also covers up anything on the bottom 28px so if you want to see credits that were there, you have to move those up.

    http://wordpress.org/extend/plugins/stick-admin-bar-to-bottom/

  2. Coen Jacobs
    Member
    Plugin Author

    Posted 3 years ago #

    I pushed version 0.2 this morning, which should fix this issue. It clears the white space at the top and adds 28 extra pixels of clearance at the bottom. :)

  3. Larry Overton
    Member
    Posted 3 years ago #

    Will try it out. Depending on the theme I don't care for the bar but being at the bottom is a useful feature for most

  4. Larry Overton
    Member
    Posted 3 years ago #

    Sorry, didn't work here. Cleared everything in cache on 3 browsers and also restarted and I have the same as with version 1. May be what I have in the header & footer though. I have allot added in both

  5. Coen Jacobs
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks for checking it, 0.2.1 should fix the remaining problems. Should be live in plugin repository any minute now.

  6. Larry Overton
    Member
    Posted 3 years ago #

    2.2 should fix it. The void at top is now gone, the credit at very bottom still hidden ( 28px or so )...in Chrome, IE 8 and Firefox. Safari, all kinds of stuff like login in the sidebar missing anyway so it does not show at all. Apple is not my cup of tea.

    All in all, I like it even if it hides the credits...That anyone can fix. What is nice about it is many of us use our own custom header and it tends to interfere while at top. Much better at bottom where the links in it can be useful to others

  7. Larry Overton
    Member
    Posted 3 years ago #

    Thought I would leave you the link to the site I am trying it on. http://www.alpost261.org/

  8. Larry Overton
    Member
    Posted 3 years ago #

    st noticed it did do 1 other thing many won't like...We lost a part of the header in admin now

  9. Coen Jacobs
    Member
    Plugin Author

    Posted 3 years ago #

    Version 0.2.2 is now live in the plugin directory. Should fix the header in admin bug. Looking into a way to show all footer contents, in a clean way, on all themes.

  10. Larry Overton
    Member
    Posted 3 years ago #

    Nice work Coen, does fix the admin header...On your way brother...lookin good!I am leaving it on active. I can deal with the footer issue as is while you make necessary changes or change that area myself for now.

    This is going to be a very useful plugin for many!

  11. Larry Overton
    Member
    Posted 3 years ago #

    Damnit...spoke just a bit soon there...it rolls the bug back in on whitespace in the header ...main pages

  12. Larry Overton
    Member
    Posted 3 years ago #

    Did allot of rework on my end just to make sure...Your plugin works with the default theme and some others I have here as is. Html in some widgets mis-aligned much of it, fixed that. As for my theme...incompatible as it stands on its own. Your plugin works fine. Nice work!

  13. Larry Overton
    Member
    Posted 3 years ago #

    top fix for me is resize the background pic by 200px and set the design for no zoom. If no background pic, no fix would be needed.

    Bottom fix is: Just before <div id="footer-body">
    Put in:

    <table style="width: 100%" cellspacing="0" cellpadding="0">
    <tr>
    <td bgcolor="#212121" style="height: 40px" valign="top"><font size="2"> All Credits Here</font></td>
    </tr>
    </table>

    Looks much better than originally and works in Opera, Safari, Firefox, Chrome and IE 8. In Safari and Opera, the admin bar does not show for me even with the default theme

  14. quietcity
    Member
    Posted 3 years ago #

    To make this truly work, you must remove the style in the WP core that tells the HTML property to add a margin. Go to your wp-includes directory and edit "admin-bar.php".

    At line 309, change this:

    function _admin_bar_bump_cb() { ?>
    <style type="text/css">
    	html { margin-top: 28px !important; }
    	* html body { margin-top: 28px !important; }
    </style>

    To this:

    function _admin_bar_bump_cb() { ?>
    <style type="text/css">
    /*	REMOVE TOP MARGIN FOR ADMIN BAR TO BOTTOM PLUGIN
    	html { margin-top: 28px !important; }
    	* html body { margin-top: 28px !important; }
    */
    </style>

    Reload the page and the margin is gone.

    I always recommend commenting out code instead of deleting it, in case you ever have to revert the site.

  15. Larry Overton
    Member
    Posted 3 years ago #

    Absolutely Perfect now! That admin bar.php mod completes it for my use. Thanks to you both!

  16. Coen Jacobs
    Member
    Plugin Author

    Posted 3 years ago #

    True, this works. But the thing is; changing core files is always a no go. I'm not happy with the '!important' part of the CSS of the admin bar, it should be done without that kind of code. But changing core files is never a good thing.

    That's the reason why I added a negative padding to the body, but that doesn't seem to work in all themes.

  17. Larry Overton
    Member
    Posted 3 years ago #

    Everything seems to work in all of my themes but the one I use. So, whatever it takes! My theme is a new one not yet unglitched as yet...or possibly because I seen the need to customize part of the javascript to NOT work. I for one am not one to care what core file or anything else has to be changed as long as it suits my need. Al;ways a new file can be uploaded again at worst.

  18. Heartwood
    Member
    Posted 3 years ago #

    Instead of changing core files (and trying to keep track of what needs to be changed or added or removed every time you upgrade), here's a way to override any css you don't like in the core files and in any plugins that add css:

    Create a css file called override.css and put it in the same directory as your theme's style.css file. Fill it with any style declarations you need to override anything declared elsewhere.

    Then, in the functions.php file of your theme, add this code:

    <?php function stylesheet_override() { ?>
    
    <link rel="stylesheet" id="overridecss"  href="<?php bloginfo('stylesheet_directory')?>/override.css" type="text/css" media="all" />
    
    <?php
    }
    add_action('wp_head', 'stylesheet_override',20);
    ?>

    Add it after the existing closing ?> or else remove the first <?php and last ?> from the above code.

    The function is called by <?php wp_head(); ?>, so make sure your theme includes that in the <head> part of the header.php file.

    The number in the add_action arguments is the priority. The number 20 is used here to make sure the code is inserted after the other css in the <head>. If that's still not high enough a number to make it show up last in the source code, just replace it with a higher number. Being listed last is what makes it override rather than be overridden.

  19. Heartwood
    Member
    Posted 3 years ago #

    Actually, there are some simpler ways to override core and plugin css:

    Create the override css file as in my previous post, but instead of making a function for it in the functions.php file, link to it in your theme's header.php directly, by adding this part of the code in-between <?php wp_head(); ?> and the closing </head> tag:

    <link rel="stylesheet" id="overridecss" href="<?php bloginfo('stylesheet_directory')?>/override.css" type="text/css" media="all" />

    OR:

    Make your override styles part of the theme's style.css and then, in your theme's header.php, find the line that calls the style.css file -- usually something like this:
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    -- and move it to be in-between <?php wp_head(); ?> and the closing </head> tag.

    Of course, if you want to override something a certain way independently of the theme you use, it's useful to have the function as a plugin instead of in a specific theme's functions.php file or header.php file.

    In that case, you'd want the override.css file to be in the plugin's directory, and the path to it would need to be changed accordingly, using plugin_url. Or you could do it the way Coen has, where the style declarations are included in the function itself and added to each page instead of linked as an external stylesheet. But I recommend linking.

    Either way, I recommend having the function triggered by wp_head instead of wp_footer, so that the output can be in the <head> section of the html instead of in the <body>. The way to make sure it overrides rather than is overridden is to include the priority number, as explained in my previous post.

    Of course, if you don't know CSS, you're dependent on someone who does no matter which way you choose to override. But I definitely agree with Coen that the styles introduced by the _admin_bar_bump_cb() function should be overridden rather than altering the wp-includes/admin-bar.php file.

  20. johngoold
    Member
    Posted 2 years ago #

    I agree with what has been said about not altering core code.

    However, I do have an issue with what this thread is all about. Why on earth would someone put into the core code (apparently starting with WP 3.1.0) something that would break people's themes? I just wasted an hour tracking this problem down and then confirming my diagnosis was correct by searching for and finding this thread.

    So, we use a workaround that is legitimate and doesn't alter core code. Now, what happens when someone wakes up and either removes that style (which should never have shown in in first place) from the core code (or better yet, figures out how to make it conditional so it only shows up for the admin theme (or wherever it is actually needed)?

    My workaround won't actually break, but I wouldn't be surprised if the effect would be that some people lose 28px of the top of their page.

  21. Heartwood
    Member
    Posted 2 years ago #

    I imagine the disregard for breaking older themes is probably related to the idea that all themes in the repository are required to be kept current with any core upgrades. I imagine all themes in there now are able to accommodate the admin bar, or they wouldn't still be in the repository. When the admin bar was added and needed a spatial spot left open for it, I imagine the themes that didn't already have the body code in a wrapper div had to have one added to keep the theme in the repository.

    Premium themes, which are not in the repository in the first place, would tend to be updated as well (at least for a few years after release), since you can't very well sell something that's not going to keep pace with what it's meant to be used for.

    If you wanted to use a theme that's no longer in the repository, the way to fix it to accommodate the admin bar would be to add a <div> tag right after the <body> tag (in the theme's header.php file), and a </div> tag right before <?php wp_footer(); ?>, which in turn is right before the </body> tag (in the theme's footer.php file). Putting everything but the admin bar into a wrapper div allows the added top-margin to push everything down while still keeping the same spatial relationships between the elements inside it, because for anything with an absolute positioning, it's absolute in relation to its containing element rather than in relation to the body.

  22. johngoold
    Member
    Posted 2 years ago #

    Ummm... I said "people's themes". I should have made it clear I was not referring to themes in the repository or purchased, commercial themes. I really did mean "people's themes" — those individuals with their own web site who installed WordPress and created their own theme.

    I encountered the problem when working on a site using its own theme. It DOES NOT HAVE THE ADMIN BAR. It did, however, end up with 28px of background colour above the masthead (header, whatever).

    I fixed the problem using a variation of the original suggestion you made (thank you Heartwood, I appreciate your contributions). I'll try your latest suggestion to see if that solves the problem in a cleaner way.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic