Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

After modifying the code in my functions.php file to display a different logo on my login page, I'm getting a blank square instead. I've added a custom .png image (326x67) to my (child) theme's image folder, and the code I've added to functions.php is as follows:

function custom_loginlogo() {
echo '<style type="text/css">
h1 a {background-image: url('.get_bloginfo('template_directory').'/images/login_logo.png) !important; }
</style>';
}
add_action('login_head', 'custom_loginlogo');

Could it be a permissions problem (like an .htaccess file blocking the image)?

share|improve this question

1 Answer

up vote 1 down vote accepted

If you are using a child theme then maybe you should try the following code. Not necessary to put !important too unless some other plugin or code is overwriting it.

function custom_loginlogo() {
    echo '<style type="text/css">
    h1 a { background-image: url('.  get_stylesheet_directory_uri().'/images/login_logo.png); }
    </style>';
}
add_action('login_head', 'custom_loginlogo');
share|improve this answer
Fantastic, thank you. – Teknophilia Dec 10 '11 at 3:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.