Skip to content

Instantly share code, notes, and snippets.

@neilgee
Last active July 14, 2017 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neilgee/584ee1662754d0b9334815b563470298 to your computer and use it in GitHub Desktop.
Save neilgee/584ee1662754d0b9334815b563470298 to your computer and use it in GitHub Desktop.
Custom Logo WordPress Login
<?php
// When using a child theme
// Hard code logos width and height in the inline style sheet below
add_action('login_head', 'custom_login_logo');
// CUSTOM LOGIN LOGO, LINK AND IMAGE DESCRIPTION
function custom_login_logo() {
echo '<style type="text/css">
.login h1 a { background-image:url(' . get_stylesheet_directory_uri() . '/images/logo.png) !important; width: 260px; !important; height: 60px !important; background-size: 100% 100% !important; margin-bottom: 60px !important;}
</style>';
}
add_filter( 'login_headerurl', 'custom_login_url', 10, 4 );
function custom_login_url() {
return site_url();
}
add_filter("login_headertitle","login_header_title");
function login_header_title() {
return get_bloginfo('name');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment