Last active
July 4, 2017 09:18
-
-
Save ingozoell/d1e2278071696259c3ba154c73558e67 to your computer and use it in GitHub Desktop.
WordPress: Conditional load IE Scripts
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
function iz_old_ie_scripts() { | |
if (!is_admin()) { | |
// Make responsive websites and media queries work in IE8 | |
// wp_register_script( 'respond', ( '//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js' ), FALSE, NULL, FALSE ); | |
// wp_script_add_data( 'respond', 'conditional', 'lt IE 9' ); | |
// Support for :nth-child(n), :last-child, etc in IE8 | |
wp_register_script( 'selectivizr', ( '//cdnjs.cloudflare.com/ajax/libs/selectivizr/1.0.2/selectivizr-min.js' ), array('jquery'), NULL, FALSE ); | |
wp_script_add_data( 'selectivizr', 'conditional', 'lt IE 9' ); } | |
} | |
add_action( 'wp_enqueue_scripts', 'iz_old_ie_scripts', 1 ); |
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
<!--[if lt IE 9]> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script> | |
<![endif]--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment