Much of WordPress login page can be easily changed with WordPress Plugins (search for “login”). It can also be changed by manually adding code to the WordPress Theme’s functions.php file.
In this tutorial I’ll show you how to get started with modifying the login screen so you can customize it to look exactly how you want. WordPress uses CSS to display a background image — the WordPress logo — in the link (<a>) inside the heading tag (<h1>). You can use the login_enqueue_scripts hook to insert CSS into the head of the login page so your logo loads instead. To use the code below, replace the file named logo.png with the file-name of your logo, and store your logo with your active Theme files in a directory named /images.
open up your theme’s functions.php file and add the following code:
[php]
// change the logo
function my_login_logo() { ?>
<style type="text/css">
.login h1 a {
background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/images/logo.png);
background-size: 300px;
width: 300px;
}
</style>
<?php }
add_action( ‘login_enqueue_scripts’, ‘my_login_logo’ );
//change link to your own site not wordpress.org
function my_login_logo_url() {
return get_bloginfo( ‘url’ );
}
add_filter( ‘login_headerurl’, ‘my_login_logo_url’ );
[/php]
Comments