Skip to content

Instantly share code, notes, and snippets.

@bhubbard
Forked from jeremyfelt/gist:1960725
Created June 30, 2013 06:01
Show Gist options
  • Save bhubbard/5894054 to your computer and use it in GitHub Desktop.
Save bhubbard/5894054 to your computer and use it in GitHub Desktop.
<?php
/* Register our IE specific stylesheets. */
wp_register_style( 'prefix-ie7-only', get_template_directory_uri() . '/css/ie7.css' );
wp_register_style( 'prefix-ie8-only', get_template_directory_uri() . '/css/ie8.css' );
wp_register_style( 'prefix-ie9-only', get_template_directory_uri() . '/css/ie.css' );
/* Use the global wp_styles object to add our conditional statements due to the lack
* of conditional support in wp_register_style
*/
$wp_styles->add_data( 'prefix-ie9-only', 'conditional', 'IE 9' );
$wp_styles->add_data( 'prefix-ie8-only', 'conditional', 'IE 8' );
$wp_styles->add_data( 'prefix-ie7-only', 'conditional', 'lt IE 8' );
/* Enqueue the IE specific stylesheets, now with conditional statements attached via global */
wp_enqueue_style( 'prefix-ie7-only' );
wp_enqueue_style( 'prefix-ie8-only' );
wp_enqueue_style( 'prefix-ie9-only' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment