Skip to content

Instantly share code, notes, and snippets.

@arod2634
Created September 22, 2012 03:36
Show Gist options
  • Save arod2634/3765033 to your computer and use it in GitHub Desktop.
Save arod2634/3765033 to your computer and use it in GitHub Desktop.
Customize Wordpress Admin Login
<?php
// Custom login styles
function custom_login_styles() {
echo '<style type="text/css">
.login h1 a { background-image:url('.get_template_directory_uri().'/images/logo.png) !important; text-align: center !important; width: 350px !important; background-size: 234px; 82px !important;}
body {background-color: #F6F6F6!important;}
div.updated, .login .message {color: #fff !important; border-color: #950639 !important; background-color: #CF153D !important;}
</style>';
}
add_action('login_head', 'custom_login_styles');
// Changing the login page URL
function my_login_logo_url() {
return home_url();
}
add_filter( 'login_headerurl', 'my_login_logo_url' );
// Changing the login page URL hover text
function my_login_logo_url_title() {
return get_bloginfo( 'title' );
}
add_filter( 'login_headertitle', 'my_login_logo_url_title' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment