Skip to content

Instantly share code, notes, and snippets.

show_admin_bar(false);
#wpadminbar {
display: none;
}
add_action('admin_bar_menu', 'add_toolbar_items', 11);
function add_toolbar_items($wp_admin_bar) {
$wp_admin_bar->add_node( array(
'id' => 'supportlink',
'title' => 'Contact support',
'href' => 'mailto:support@domain.com',
) );
}
add_action('admin_bar_menu', 'add_toolbar_items', 999);
function remove_toolbar_items($wp_adminbar) {
$wp_adminbar->remove_node('wpseo-menu');
}
add_action('admin_bar_menu', 'remove_toolbar_items', 999);
#wpadminbar .quicklinks>ul>li {
position:relative;
}
#wpadminbar .ab-top-menu>.menupop>.ab-sub-wrapper {
bottom: 32px;
}
body.admin-bar {
margin-top: -32px;
padding-bottom: 32px;
}
#wpadminbar {
top: auto !important;
bottom: 0;
}
function style_tool_bar() {
echo '
<style type="text/css">
#wpadminbar {
background: blue;
}
</style>';
}
add_action( 'admin_head', 'style_tool_bar' );
add_action( 'wp_head', 'style_tool_bar' );
@nschaeferhoff
nschaeferhoff / customize WordPress toolbar 1
Last active November 17, 2017 10:55
Customize WordPress toolbar 1
#wpadminbar {
background: blue;
}