Last active
November 14, 2019 09:31
-
-
Save odil-io/267d9b2a349268bee0269f4a150a36bc to your computer and use it in GitHub Desktop.
WordPress: Easily 'White Label' /wp-admin/
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
<?php | |
add_action('login_head', function() { | |
$custom_logo_id = get_theme_mod( 'custom_logo' ); | |
$logo = wp_get_attachment_image_src( $custom_logo_id , 'full' ); | |
if ( has_custom_logo() ) { | |
echo '<style type="text/css"> | |
.login h1 a { | |
background-image:url(' . esc_url( $logo[0] ) . ') !important; | |
background-size:contain; | |
width: 100%; | |
height: 84px; /* edit to your specification. Default is 84px. */ | |
} | |
</style>'; | |
} | |
}); | |
add_filter( 'login_headerurl', function($url) { | |
return esc_url( get_bloginfo('url') ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment