Last active
December 10, 2015 22:38
-
-
Save SleeplessByte/4503383 to your computer and use it in GitHub Desktop.
Changes the login logo to a theme based one.
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 | |
/** | |
* Changes the login logo and sets the appropiate sizes | |
*/ | |
function custom_login_logo() { | |
$path = '/images/logo_login.png'; | |
$size = getimagesize( get_template_directory() . $path ); | |
if ( $size ) : | |
echo '<style type="text/css"> | |
.login h1 a { | |
background-image: url(' . get_bloginfo('template_directory') . $path .'); | |
background-size: ' . $size[0] . 'px ' . $size[1] . 'px ; | |
height: ' . $size[1] . 'px; | |
} | |
</style>'; | |
endif; | |
} | |
add_action('login_head', 'custom_login_logo'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment