0

I'm trying to do exactly what was apparently achieved in this discussion.

However, I'm finding that my IE-specific stylesheet's being loaded all the time!

My parent theme includes this in its functions.php:

wp_enqueue_style( 'twentytwelve-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentytwelve-style' ), '20121010' );

And I'm adding this to my child theme's functions.php - which, if I understand correctly, should remove the parent version of ie.css and replace it with mine:

function PREFIX_remove_scripts() {
wp_dequeue_style( 'twentytwelve-ie' );

// Now register your styles and scripts here
wp_enqueue_style( 'treetop-ie', get_stylesheet_directory_uri() . '/css/ie.css',     array( 'twentytwelve-style' ), '20121010' );

}

add_action( 'wp_enqueue_scripts', 'PREFIX_remove_scripts', 200 );

Well, my ie.css is loading, all right, but in all browsers.

What did i get wrong?

Thanks... adam

6
  • Why are you changing the priority of add_action()? Commented Oct 2, 2013 at 16:35
  • possible duplicate of Enqueue different stylesheets using IE conditionals
    – kaiser
    Commented Oct 2, 2013 at 16:42
  • You're just asking the wrong question. It should read what I've linked as duplicate.
    – kaiser
    Commented Oct 2, 2013 at 16:42
  • Thanks for this, kaiser - I will have a good read of that linked discussion. Commented Oct 4, 2013 at 16:17
  • Chip, I think I am simply not 100% clear on the correct usage of add_action(), sadly. I'm trying to wrap my head around it 100%. But I'll see if perhaps this approach is rendered moot by the solutions in the linked discussion. Commented Oct 4, 2013 at 16:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.