wp_register_style conditional comments (2 posts)

  1. peterwilson
    Posted 6 years ago #


    Using wp_register_style() in WordPress 2.7, is it possible to specify that a style sheet should be surrounded by conditional comments?

    The same would be helpful for scripts, but I'm only worried about CSS for the time being.

  2. xdissent
    Posted 6 years ago #

    Conditional comments are possible, but no convenience function exists to handle them yet. After you call wp_register_style('ie-style', '/css/ie.css'); just import the main WordPress style registry with global $wp_styles; and add the conditional data to the style entry through the registry's add_data method: $wp_styles->add_data('ie-style', 'conditional', 'IE');

Topic Closed

This topic has been closed to new replies.

About this Topic