Forum Replies Created

Viewing 5 replies - 16 through 20 (of 20 total)
  • Thread Starter gilgimech

    (@gilgimech)

    This seems to work.

    if ((error_reporting() && is_admin())) {
        echo '<style>body{ padding-top: 28px !important; }</style>';
        return;
    }

    If there is an error it adds padding to the body pushing everything down except the tool bar.

    Thread Starter gilgimech

    (@gilgimech)

    And yes, the core team thought about that. They do this instead: https://nacin.com/tag/wp_debug/

    Which part are you referring to? I didn’t see anything that would solve the toolbar covering the errors issue.

    Thread Starter gilgimech

    (@gilgimech)

    You can turn it off in the backend.

    this worked for me.

    if (!function_exists('disableAdminBar')) {
    
    	function disableAdminBar() { // begin disableAdminBar function
    
    		remove_action( 'admin_footer', 'wp_admin_bar_render', 1000 );
    
    		function remove_admin_bar_style_backend() {
    			echo '<style>body.admin-bar #wpcontent, body.admin-bar #adminmenu { padding-top: 0px !important; }</style>';
    		}
    
    		add_filter('admin_head','remove_admin_bar_style_backend');
    
    	}  
    
    }
    
    add_action('init','disableAdminBar');

    I know it’s not the best way of doing it, but when your developing themes and plugins you need to be able to see those errors. So the toolbar has to go (for developing anyway). I don’t recommend doing something like that for a live site.

    I don’t think they thought about that when the core team designed this new toolbar.

    Oh wait, sorry I just noticed that the code was right there. try this.

    if (!function_exists('disableAdminBar')) {
    
    	function disableAdminBar() { // begin disableAdminBar function
    
    		remove_action( 'admin_footer', 'wp_admin_bar_render', 1000 );
    
    		function remove_admin_bar_style_backend() {
    			echo '<style>body.admin-bar #wpcontent, body.admin-bar #adminmenu { padding-top: 0px !important; }</style>';
    		}
    
    		add_filter('admin_head','remove_admin_bar_style_backend');
    
    	}  
    
    }
    
    add_action('init','disableAdminBar');

    But the real problem is that the admin bar is also the header now, so if you remove it’ll remove the login stuff in the right corner. I’m working on a way to restore the header to the way it was in vs 3.2. I don’t like the admin bar either, but I’m going to live with it for now.

    Try putting this in you functions.php file.

    if (!function_exists('disableAdminBar')) {
    
    	function disableAdminBar(){
    
      	remove_action( 'admin_footer', 'wp_admin_bar_render', 1000 );
    
        function remove_admin_bar_style_backend() {
          echo '<style>body.admin-bar #wpcontent, body.admin-bar #adminmenu { padding-top: 0px !important; }</style>';
        }
    
        add_filter('admin_head','remove_admin_bar_style_backend');
    
      }
    
    }
    
    add_filter('admin_head','remove_admin_bar_style_backend');
Viewing 5 replies - 16 through 20 (of 20 total)