Here´s something to get you started.
- Adapt the code below to your needs
- Create an init.js file with notepad and paste your code in there
- Save it in a logical place your theme folder (the JS directory for example)
- Register and enqueue this file (make sure to load it after jquery)
Datepicker set up:
/* http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_wrappers */
jQuery(document).ready(function($) {
/* For all options see http://jqueryui.com/demos/datepicker/ */
$("#datepicker").datepicker({
defaultDate: +2,
minDate: 0,
maxDate: '+2y',
numberOfMonths: 1,
showAnim: 'fadeIn',
showButtonPanel: true,
buttonImageOnly: true,
buttonText: 'Pick a date',
showOn: 'both'
});
});
Related Posts:
- How to use date picker in Angular 2?
- jQuery UI Datepicker not working
- Add `datetimepicker` to form
- Ajaxify calendar
- How to use datepicker.min.js?
- What is the propre way to include jQuery UI Datepicker’s CSS in plugin?
- datepicker for custom post type admin
- wp_enqueue_script jquery and jquery ui not working
- Uncaught TypeError: Object # has no method ‘datepicker’ [closed]
- AJAX calendar navigation returns -1
- jQuery Datepicker displays wrong language until interection with the calendar
- WP Calendar Shortcode not working on my theme
- How to allow multiDatesPicker in wp admin post type?
- jQuery datepicker not showing on admin menu
- JSON parsing error syntax error unexpected end of input
- jQuery Selector: Id Ends With?
- jQuery dialog popup
- Change Placeholder Text using jQuery
- Click button copy to clipboard
- $(document).on(“click”… not working?
- How to read data From *.CSV file using javascript?
- how to loop through JSON array in jQuery?
- jQuery – how to write ‘if not equal to’ (opposite of ==)
- jQuery get the image src
- Get element type with jQuery
- jQuery onclick toggle class name
- how to define variable in jquery
- Enqueue core jQuery in the footer?
- How to correctly include jquery-ui effects on wordpress
- Check if user is logged in using JQuery
- I want to enqueue a .js file to my child theme
- How to prevent WordPress from loading the jQuery library at the top of the page
- Adding jquery and thickbox to WordPress theme
- WooCommerce single product edit flexslider settings
- jquery & ajax getting data to php in wordpress
- AJAX returns response 0
- WordPress Featured Post Slider
- possible to make sections in theme customizer sortable and saveable at publish button clicked?
- adding the full image path to a wordpress javascript file
- Unable to run jQuery script in my template file
- How disable checkbox when listbox value changes in tinymce
- Modify this loop to fit my jQuery slider (slides)
- validate a metabox based on the category that is selected
- wp_mail very slow
- Clicking on disabled ‘add to cart’ button [closed]
- WordPress loads Jquery Automatically – is my idea correct to add it to the footer?
- Unable to uncheck checkbox with jquery in wp admin
- Front-end Ajax File Upload
- jQuery.accordion isn’t a function even when enqueued
- jQuery ajax call throws an HTTP 302
- Multiple jQuery conflict unsure of why
- How Can I Add “New” Lazy Load Images To NewsPaper WP Theme? [closed]
- WooCommerce Ajax Cart Update Stopped Working
- WordPress AJAX Load More function duplicating a post
- Sorting widget control
- Plugins loading multiple copies of JQuery
- How to wp_enqueue_script jQuery inside a Plugin
- Cannot enqueue jQuery correctly using Google CDN
- jQuery accordion plugin won’t work once used in WP
- Why use admin-ajax.php when loading pages through AJAX?
- Insertng HTML and jQuery into a page that uses the Defaut template
- WP Rest Api / Ajax POST not working when not logged in
- Admin side jquery is not loaded
- How do I translate string inside jQuery script with WPML?
- Using Foundation 5 in WordPress Administration Area
- change order of add_action hooks for jquery to be loaded first
- Can’t delete the default jQuery in the theme
- WordPress jQuery crash [closed]
- Conditional Tags – Multiple Categories
- Using Jquery submit with ajax request
- Slider’s missing navigation
- Assigning tags to a post from front end using tag-it jquery UI plugin
- Adding Widgets to Masonry Layouts Correctly – jQuery &&|| PHP
- How to declare/provide file path in JQuery which is emeeded in the WordPress theme
- Name of JQuery technique used on this site [closed]
- Drag and Drop Metadata Menu Order
- need jquery help
- How to enable read more by default using jquery
- Show More Show Less – Not Working
- Trying to add google ad onclick to wordpress and Divi buttons and header link
- how to allow download after newsletter subscription?
- How to insert fancybox to multiple separate galleries in a post?
- jQuery Plugin Uncaught TypeError: jQuery(…).slider is not a function
- How to use jQuery plugin
- Notify user we would like them to clear their cookie. Provide a working button to clear cookies for user
- Call full image url instead of stylsheet directory url in JS for Infinite Scroll Function
- Passing variable data from external jQuery file to options.php
- Custom Javascript not working? [closed]
- Uncaught TypeError: Cannot read property ‘ajax’ of undefined
- :first-child applying to all links [closed]
- Ajax autocomplete based on usercode
- Jquery script not loading on site Front page
- Get selected value with PHP and jQuery
- Javascript block in Twenty Twelve theme
- Can’t get this jQuery snippet to work with WordPress
- Javascript Loading Effect to URLs
- How to combine jQuery in-place editor with $wpdb->update
- Does anyone know how to load jquery in the footer?
- Use WordPress Built In Jquery
- Enqueued jQuery not working