Skip to content

Instantly share code, notes, and snippets.

@hereswhatidid
Created July 11, 2013 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hereswhatidid/5979556 to your computer and use it in GitHub Desktop.
Save hereswhatidid/5979556 to your computer and use it in GitHub Desktop.
Add an IE conditional requirement to an registered style in WordPress
<?php
if ( !is_admin() ) {
$theme = get_theme( get_current_theme() );
wp_register_style( 'your-style', get_bloginfo( 'stylesheet_directory' ) . '/css/ie.css', false, $theme['Version'] );
$GLOBALS['wp_styles']->add_data( 'your-style', 'conditional', 'lte IE 8' );
wp_enqueue_style( 'your-style' );
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment