Skip to content

Instantly share code, notes, and snippets.

@michaelbragg
Created June 17, 2014 09:48
Show Gist options
  • Save michaelbragg/e1a7efcba3c721861b98 to your computer and use it in GitHub Desktop.
Save michaelbragg/e1a7efcba3c721861b98 to your computer and use it in GitHub Desktop.
WordPress lt-ie8
/**
* HTML5 Shiv
* Enables use of HTML5 sectioning elements in legacy Internet
* Explorer and provides basic HTML5 styling for Internet Explorer 6-9
*/
// add ie conditional html5 shim to header
function add_ie_html5_shim () {
echo '<!--[if lt IE 9]>';
echo '<script src="'. get_stylesheet_directory_uri() .'/js/lib/html5shiv-printshiv.js"></script>';
echo '<![endif]-->';
}
add_action('wp_head', 'add_ie_html5_shim');
/**
* Respond
* A fast & lightweight polyfill for min/max-width CSS3 Media Queries
* (for IE 6-8, and more).
*/
// add ie conditional respond to header
function add_ie_respond () {
echo '<!--[if lt IE 9]>';
echo '<script src="'. get_stylesheet_directory_uri() .'/js/lib/respond.min.js"></script>';
echo '<![endif]-->';
}
add_action('wp_head', 'add_ie_respond');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment