Skip to content

Instantly share code, notes, and snippets.

@WordPress-Handbuch
Last active April 11, 2019 07:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WordPress-Handbuch/c74c1ea5eac5b2f0f340fd0060b57e58 to your computer and use it in GitHub Desktop.
Save WordPress-Handbuch/c74c1ea5eac5b2f0f340fd0060b57e58 to your computer and use it in GitHub Desktop.
Exchange the WordPress backend dashboard logo in the top left corner (should be 20px by 20px) through functions.php action hook
function wh_wordpress_backend_custom_logo() {
echo '
<style type="text/css">
#wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before {
background-image: url(' . get_bloginfo( 'stylesheet_directory' ) . '/images/custom-logo.png) !important;
background-size: 20px 20px;
background-position: 0 0;
color:rgba(0, 0, 0, 0);
}
#wpadminbar #wp-admin-bar-wp-logo.hover > .ab-item .ab-icon {
background-position: 0 0;
}
</style>
';
}
add_action( 'wp_before_admin_bar_render', 'wh_wordpress_backend_custom_logo' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment