Created
January 12, 2016 21:41
-
-
Save priscillamc/f1f4a989d4109edda6cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add styles and scripts to a WordPress site | |
* | |
* See https://codex.wordpress.org/Class_Reference/WP_Styles#Conditional_Styles | |
*/ | |
function my_scripts_styles(){ | |
global $wp_styles; | |
// Load IE version-specific stylesheets | |
wp_enqueue_style( 'html5shiv', 'https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js', array(), '3.7.2', 'screen' ); | |
$wp_styles->add_data( 'html5shiv', 'conditional', 'lt IE 9' ); | |
} | |
add_action('wp_enqueue_scripts', 'my_scripts_styles'); | |
<!-- HTML OUTPUT --> | |
<!--[if lt IE 9]> | |
<link rel='stylesheet' id='html5shiv-css' href='https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js?ver=3.7.2' type='text/css' media='screen' /> | |
<![endif]--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment