Last active
April 2, 2020 23:42
-
-
Save someguy9/797262b1a4c02966946dde97495aa361 to your computer and use it in GitHub Desktop.
Adds a custom logo to the top left of the WordPress admin
This file contains 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
<?php | |
//Adds a custom logo to the top left of the WordPress admin | |
function smartwp_custom_logo_wp_dashboard() { | |
echo "<style type='text/css'> | |
#wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before { | |
background-image: url('" . get_bloginfo('stylesheet_directory') . "/admin-icon.png'); | |
background-size: contain; | |
background-position: 0 0; | |
color:rgba(0, 0, 0, 0); | |
} | |
#wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon { | |
background-position: 0 0; | |
} | |
</style>"; | |
} | |
add_action('wp_before_admin_bar_render', 'smartwp_custom_logo_wp_dashboard'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment