Created
February 28, 2016 08:47
-
-
Save carlodaniele/df8e057dca5b36fc951f to your computer and use it in GitHub Desktop.
Login page logo customization
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 | |
/** | |
* Replace default login logo with custom image | |
* | |
* @link https://codex.wordpress.org/Plugin_API/Action_Reference/login_head | |
*/ | |
function my_login_logo() { | |
echo '<style type="text/css">.login h1 a { background-image:url('. get_stylesheet_directory_uri() .'/imgs/super_wp.png); }</style>'; | |
} | |
add_action('login_head', 'my_login_logo'); | |
/** | |
* Replace default header URL | |
* | |
* @link https://codex.wordpress.org/Plugin_API/Filter_Reference/login_headerurl | |
*/ | |
function my_login_logo_url() { | |
return home_url(); | |
} | |
add_filter( 'login_headerurl', 'my_login_logo_url' ); | |
/** | |
* Replace header link title attribute | |
*/ | |
function my_login_header_link_title() { | |
return 'Example WordPress Website'; | |
} | |
add_filter( 'login_headertitle', 'my_login_header_link_title' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment