Skip to content

Instantly share code, notes, and snippets.

@wpbandit
Created February 20, 2012 01:28
Show Gist options
  • Save wpbandit/1867033 to your computer and use it in GitHub Desktop.
Save wpbandit/1867033 to your computer and use it in GitHub Desktop.
WP Load JS
<?php
// Add action to enqueue scripts
add_action('wp_enqueue_scripts','theme_javascript');
// Function to load theme javascript
function theme_javascript() {
// Register slider script
wp_register_script('slider',get_template_directory_uri().'js/jquery.slider.js',array('jquery'),'1.0');
// Enqueue theme script
wp_enqueue_script('theme',get_template_directory_uri().'js/theme.js',array('jquery','slider'),'1.0');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment