Skip to content

Instantly share code, notes, and snippets.

@daltonrooney
Created November 18, 2011 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daltonrooney/1377486 to your computer and use it in GitHub Desktop.
Save daltonrooney/1377486 to your computer and use it in GitHub Desktop.
Proper way to load WordPress scripts (should be in functions.php)
<?php
function xx_load_scripts() {
wp_enqueue_script( 'jquery' );
wp_register_script( 'cycle', plugins_url( 'js/jquery.cycle.all.min.js', dirname(__FILE__) ), false, '2.99', true );
wp_enqueue_script( 'cycle' );
}
add_action('wp_enqueue_scripts', 'xx_load_scripts');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment