Last active
August 19, 2016 15:16
-
-
Save mspalex/aa28001235506910b856 to your computer and use it in GitHub Desktop.
Wordpress - Alter login page Logo and corresponding URL
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 | |
// Customize the WP Logo, on login page; Replace it with your clients logo | |
add_action('login_head', 'my_custom_login_page'); | |
function my_custom_login_page() { | |
echo '<style type="text/css"> | |
h1 a { | |
background: url('.get_bloginfo('template_directory').'-child/img/logo.png) no-repeat center center !important; | |
width: 200px !important; } | |
.login #login_error{ | |
display:none; } | |
</style>';} | |
// Change the Logo URL, since it points to wordpress.com | |
add_filter( 'login_headerurl', 'my_login_logo_url' ); | |
function my_login_logo_url() {return home_url();} | |
// Remove login errors | |
add_filter( 'login_errors', 'no_wordpress_errors' ); | |
function no_wordpress_errors(){echo '';} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment