Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Created October 29, 2013 11:59
Show Gist options
  • Save mikejolley/7213366 to your computer and use it in GitHub Desktop.
Save mikejolley/7213366 to your computer and use it in GitHub Desktop.
Enqueue a script which uses a jquery ui datepicker http://jqueryui.com/datepicker/
add_action( 'wp_enqueue_scripts', 'custom_enqueue_datepicker' );
function custom_enqueue_datepicker() {
// Optional - enqueue styles
wp_enqueue_style( 'jquery-ui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/smoothness/jquery-ui.css', false, '1.0', false );
// Enqueue YOURTHEME/js/datepicker.js
wp_enqueue_script( 'your-datepicker-script', get_stylesheet_directory_uri() . '/js/datepicker.js', array( 'jquery', 'jquery-ui-datepicker' ), '1.0', true );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment