WordPress.org

Ready to get started?Download WordPress

Forums

Front-End Users
Disable _admin_bar_bump_cb? (2 posts)

  1. chicagoave
    Member
    Posted 2 years ago #

    My theme uses a 0px margin for the body of my page. By default when the admin bar is displayed wordpress adds a 28px top margin to the body so the admin bar has room to be displayed. This function is defined in the admin-bar.php wp-includes.

    /**
     * Default admin bar callback.
     *
     * @since 3.1.0
     *
     */
    function _admin_bar_bump_cb() { ?>
    <style type="text/css">
    	html { margin-top: 28px !important; }
    	* html body { margin-top: 28px !important; }
    </style>
    <?php
    }

    When I use FEU your script hides the admin bar but the bump function still pushes down my page messing up my layout. Is it possible to remove that action as part of the disable_wp_admin_bar functions in FEU?

    private function disable_wp_admin_bar() {
    		remove_action('init','wp_admin_bar_init');
    		remove_filter('init','wp_admin_bar_init');
    		remove_action('wp_head','wp_admin_bar_render',1000);
    		remove_filter('wp_head','wp_admin_bar_render',1000);

    etc...

    Thanks.

    http://wordpress.org/extend/plugins/front-end-users/

  2. briansage
    Member
    Posted 2 years ago #

    function my_function_admin_bar(){ return false; }
      add_filter( 'show_admin_bar' , 'my_function_admin_bar');

    Found this here: http://wordpress.org/support/topic/31-update-causing-28px-top-spacing-in-html-body?replies=28

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic