Fixing Custom Login Pages in WordPress 3.4

July 4, 2012

If your WordPress blog has a customised WordPress login page and you have noticed some visual issues with it after upgrading to WordPress 3.4 then read on.

Is your logo sized incorrrectly? This is due to WordPress giving support to higher resolution displays (http://core.trac.wordpress.org/ticket/20293) and therefore requiring the use of the CSS property background-size in your custom logo code.

Your custom code is likely to be in the functions.php file of your theme. So you would need to edit it to be something like this:

function pvw_custom_login_logo() {
    echo '<style type="text/css">
        
 h1 a { background-image:url('. get_template_directory_uri() .'/images/logo.png) !important;
        background-size: auto auto !important; }
          		
    </style>';
}
add_action('login_head', 'pvw_custom_login_logo');

Do you see your blog name and URL at the top left of the page all of a sudden? This is due to an issue in your custom functions you have hooked to the actions login_headerurl and login_headertitle. These functions need to return the data not echo it:

function pvw_wp_login_url() {
	return home_url();
}
add_filter('login_headerurl', 'pvw_wp_login_url');

For more information check out:
http://codex.wordpress.org/Plugin_API/Action_Reference/login_head
http://codex.wordpress.org/Plugin_API/Filter_Reference/login_headerurl

About Iain

I am a WordPress and PHP developer building my own plugins and working with Delicious Brains. I like to blog about things, especially WordPress.