Appreciation Earth Email Email_2 Group_2

Fixing Custom Login Pages in WordPress 3.4

July 4, 2012 Uncategorized WordPress

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

Iain Building and growing WordPress products. I'm the product manager of ACF at WP Engine. I also develop plugins like WP User Manager and Intagrate. I write about the WordPress ecosystem over at WP Trends.
Comments