Last active
August 29, 2015 14:25
-
-
Save craigsimps/5b9839713ed2f9fcb843 to your computer and use it in GitHub Desktop.
Add the Modernizr JS library for Internet Explorer 8 users and below.
This file contains hidden or 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
// remove the existing loading of html5shiv | |
remove_action( 'wp_head', 'genesis_html5_ie_fix' ); | |
add_action( 'wp_enqueue_scripts', 'craigsimps_enqueue_modernizr' ); | |
/** | |
* Load the modernizr library, with built in html5shiv for users of IE8 or below. | |
*/ | |
function craigsimps_enqueue_modernizr() { | |
global $wp_scripts; | |
wp_enqueue_script( 'craigsimps-modernizr', get_stylesheet_directory_uri() . '/assets/js/modernizr.min.js', array('jquery'), '2.8.3', true ); | |
$wp_scripts->add_data( 'craigsimps-modernizr', 'conditional', 'lt IE 8'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment