Last active
April 11, 2019 07:02
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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