I've successfully enqueued a parent stylesheet and child stylesheet. I'd like to enqueue a third - ultimately a style.php file, but a second-style.css would be a good start.

It's not working for me though: can anyone tell me why?

function theme_enqueue_styles() {

        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css');
        wp_enqueue_style('second-style', get_stylesheet_directory_uri() .'/second-style.css');

add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );

I've tried registering the stylesheet first, and no cigar.

  • "It's not working" - what does it mean? – Max Yudin Jul 26 '18 at 10:14
  • with your code I see the 3 stylesheets in HTML result. what is the problem ? edit your question to add more details. – mmm Jul 26 '18 at 10:15
  • 1
    No reason that shouldn’t work that I can see. What about it isn’t working. Is the link tag not being output in the head? Or are the styles just not applying? – Jacob Peattie Jul 26 '18 at 10:15
  • Well, no rules on second-style.css is modifying the HTML, so I assume it's not recognising it. – JohnG Jul 26 '18 at 10:15
  • Good point Jacob Peattie - the link is getting output into the header... Maybe it's just my CSS that's the problem! – JohnG Jul 26 '18 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.