Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1053355
    flyingkiwi
    Participant

    Hi guys,

    I have a child theme setup and am trying to add a new folder called ‘login’ into the root of ‘x-child’ with a few files inside.

    I have the following in my child themes functions.php

    function my_loginCSS() {
        wp_enqueue_style('login-styles', get_template_directory_uri() . '/login/login_styles.css');
    }
    add_action('login_enqueue_scripts', 'my_loginCSS');

    but no matter what I try it keeps looking to /wp-content/themes/x/login instead of /wp-content/themes/x-child/login

    How can I make this point to the correct folder?

    Cheers,
    Tom

    #1053556
    Jade
    Moderator

    Hi Tom,

    Please to use get_stylesheet_directory() instead of get_template_directory_uri().

    Hope this helps.

    #1053567
    flyingkiwi
    Participant

    Hi Jade,

    Unfortunately that’s not working – it’s kicking back the following error in the chrome inspector..

    404 https://mysite.com.au/home/mysite/public_html/mysite.com.au/wp-content/themes/x-child/login/login_styles.css

    at least it’s getting closer..

    Tom

    #1053569
    flyingkiwi
    Participant

    RESOLVED!

    I updated get_stylesheet_directory() to get_stylesheet_directory_uri() and it’s now working correctly.

    Thanks!

    #1053747
    Prasant Rai
    Moderator

    Glad to hear that, feel free to get in touch with us regarding any further queries.

  • <script> jQuery(function($){ $("#no-reply-1053355 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>