Created
January 17, 2018 06:15
-
-
Save hasanm95/9e1f409e2f5a9061cd9b557f7f0426ae to your computer and use it in GitHub Desktop.
Inlclude conditonal JS in wordpress
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 site_scripts() { | |
wp_enqueue_script( 'html5shiv', '//cdn.jsdelivr.net/html5shiv/3.7.2/html5shiv.js' ); | |
wp_script_add_data( 'html5shiv', 'conditional', 'lt IE 9' ); | |
wp_enqueue_script( 'respond', get_template_directory_uri() . '/assets/js/respond.min.js' ); | |
wp_script_add_data( 'respond', 'conditional', 'lt IE 9' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'site_scripts' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment