How do I target the child theme with get_bloginfo();?

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?

Related posts

Leave a Reply

1 comment

  1. 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