Last active
July 14, 2017 02:28
-
-
Save neilgee/584ee1662754d0b9334815b563470298 to your computer and use it in GitHub Desktop.
Custom Logo WordPress Login
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 | |
// 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