Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

In the code below (which is located in my functions.php file), in reference to ('.get_bloginfo('template_url').', I'm trying to target my child theme but it keeps coming up as the parent theme.

/* ==  Custom Login Logo ==============================*/
function custom_login_logo() {
    echo '<style>
        .login h1 a { background:url('.get_bloginfo('template_url').'/images/logo-white.png) 0 0;background-size:218px 32px;height:32px;margin-bottom:10px;margin-left:20px;padding:0;width:218px }
    </style>';
}
add_action('login_head', 'custom_login_logo');

How can I make it so it targets the child theme's theme folder?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

Try get_stylesheet_directory_uri(); which

Retrieves stylesheet directory URI for the current theme/child theme

/* ==  Custom Login Logo ==============================*/
function custom_login_logo() {
    echo '<style>
        .login h1 a { background:url('.get_stylesheet_directory_uri().'/images/logo-white.png) 0 0;background-size:218px 32px;height:32px;margin-bottom:10px;margin-left:20px;padding:0;width:218px }
    </style>';
}
add_action('login_head', 'custom_login_logo');

You might need to modify the path to your image slightly depending on it's place in your theme's folder structure

share|improve this answer
    
Awesome, thank you! I'll give you the check in 6 min. –  Desi Mar 21 at 0:38
add comment

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.