Forked from braddalton/Enqueue Script Conditionally WordPress
Created
November 29, 2013 17:42
-
-
Save nhatdong/7709332 to your computer and use it in GitHub Desktop.
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
| add_action( 'wp_enqueue_scripts', 'wpsites_load_javascript_conditionally' ); | |
| function wpsites_load_javascript_conditionally() { | |
| if ( is_page('page-slug') ) { | |
| wp_enqueue_script( 'your-script' ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment