Skip to content

Instantly share code, notes, and snippets.

@evansolomon
Created July 13, 2012 18:22
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 evansolomon/3106456 to your computer and use it in GitHub Desktop.
Save evansolomon/3106456 to your computer and use it in GitHub Desktop.
JS Setup WordPress Theme
<?php
function custom_js() {
// jQuery
wp_deregister_script('jquery');
wp_register_script(
'jquery',
includes_url( 'js/jquery/jquery.js' ),
array(),
'1.7.2',
true
);
// modernizr
wp_enqueue_script(
'modernizr',
get_template_directory_uri() . '/js/vendor/modernizr.js',
array(),
'2.5.3',
false
);
// main.js
wp_enqueue_script(
'main',
get_template_directory_uri() . '/js/main.js',
array('jquery'),
'1.0',
true
);
}
add_action('wp_enqueue_scripts', 'custom_js');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment