Skip to content

Instantly share code, notes, and snippets.

@SleeplessByte
Last active December 10, 2015 22:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SleeplessByte/4503383 to your computer and use it in GitHub Desktop.
Save SleeplessByte/4503383 to your computer and use it in GitHub Desktop.
Changes the login logo to a theme based one.
<?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