Support » Plugin: WP Admin No Show » [Plugin: WP Admin No Show] Remove 28px white space in front end

  • Resolved Max Bond

    (@max-bond)


    Hi!
    There is one problem with your plugin. When the admin bar is gone, on its place there is a 28px of white space.

    Here is the code to fix it:

    Add one new fucntion:

    function remove_admin_bar_style_frontend() {
        echo '<style type="text/css" media="screen">
        html { margin-top: 0px !important; }
        * html body { margin-top: 0px !important; }
        </style>';
    }

    Add a hook to wp_admin_no_show_admin_bar_disable():

    ...
    if ( false !== $disable ) {
        add_filter( 'show_admin_bar', '__return_false' );
        remove_action( 'personal_options', '_admin_bar_preferences' );
        add_filter('wp_head','remove_admin_bar_style_frontend', 99);
    }

    http://wordpress.org/extend/plugins/wp-admin-no-show/

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: WP Admin No Show] Remove 28px white space in front end’ is closed to new replies.