0
Voted

Check if admin bar is showing before adding 32px margin

Hello, as an admin, I usually disable the default WP admin bar from settings, and so when I did that after installing microjobEngine I realized there’s a 32px margin on the top, which resulted in a broken layout, and it is ugly especially given the header is fixed.
So I traced the added CSS to the file alias-function.php under includes directory, and on line 1849 in my version, I found the line `if(current_user_can( ‘manage_options’ )){`

I suggest adding another condition to this block `is_admin_bar_showing()`, and this should solve the issue.

Meanwhile the way I did it was by adding this block of code to my child theme functions.php file

if(!is_admin_bar_showing()){
function remove_css_admin_bar(){
remove_action( ‘wp_head’, ‘add_css_admin_bar’ );
}

add_action( ‘wp_head’, ‘remove_css_admin_bar’ );
}

Created June 20, 2018 by alkateb
0
Warning! Please before comment this idea.