Customizing Your WordPress Login

There are a number of plugins and tutorials to change the login logo for a WordPress installation, so why another one? Because changing the logo isn’t enough: you probably will also want to change the underlying link—which normally takes the user to WordPress.org.

Here are a few lines that you need to add to your theme’s function.php file (better yet, add to Thesis’s custom_functions.php):

function my_custom_login_logo() {
    echo '< script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $("h1 a").attr("href", "http://www.example.com/")
            $("h1 a").attr("title", "Example: Customizing Your WordPress Login")
        });
    </script>
<style type="text/css">
h1 a { background-image:url('.get_bloginfo('template_url').'/path/to/login-image.png) !important; }</style>
';
}

add_action('login_head', 'my_custom_login_logo');

In the script—which uses jQuery to do the link manipulation—replace the href and title properties with the appropriate information, and be sure to point the CSS background-image property to the correct image location. (jQuery is expressly loaded here because WP doesn’t load it on the login page.)