Skip to content

Instantly share code, notes, and snippets.

@jhummel
Created September 19, 2013 16:53
Show Gist options
  • Save jhummel/6626354 to your computer and use it in GitHub Desktop.
Save jhummel/6626354 to your computer and use it in GitHub Desktop.
Enqueue a stylesheet with conditional tags
function bones_scripts_and_styles() {
global $wp_styles; // <-- you need this
// ie-only style sheet
wp_register_style( 'ie-only', get_stylesheet_directory_uri() . '/path/to/ie.css', array(), '' );
wp_enqueue_style( 'ie-only' );
$wp_styles->add_data( 'bones-ie-only', 'conditional', 'lt IE 9' ); // add conditional wrapper around ie stylesheet
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment