Skip to content

Instantly share code, notes, and snippets.

@mspalex
Last active August 19, 2016 15:16
Show Gist options
  • Save mspalex/aa28001235506910b856 to your computer and use it in GitHub Desktop.
Save mspalex/aa28001235506910b856 to your computer and use it in GitHub Desktop.
Wordpress - Alter login page Logo and corresponding URL
<?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