Created
June 6, 2012 15:28
-
-
Save habibmac/2882639 to your computer and use it in GitHub Desktop.
WP: Modify the login logo & image URL link
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
// This code will allow you to easily modify the WordPress Login page Logo as well as the href link and title text of this logo. | |
add_filter( 'login_headerurl', 'namespace_login_headerurl' ); | |
/** | |
* Replaces the login header logo URL | |
* | |
* @param $url | |
*/ | |
function namespace_login_headerurl( $url ) { | |
$url = home_url( '/' ); | |
return $url; | |
} | |
add_filter( 'login_headertitle', 'namespace_login_headertitle' ); | |
/** | |
* Replaces the login header logo title | |
* | |
* @param $title | |
*/ | |
function namespace_login_headertitle( $title ) { | |
$title = get_bloginfo( 'name' ); | |
return $title; | |
} | |
add_action( 'login_head', 'namespace_login_style' ); | |
/** | |
* Replaces the login header logo | |
*/ | |
function namespace_login_style() { | |
echo '<style>.login h1 a { background-image: url( ' . get_template_directory_uri() . '/images/logo.png ) !important; }</style>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment