I am using Advanced Custom Fields in my WordPress project. In it I have added 2 datepickers as custom fields for pages.

Now the main problem is whenever I add a new page both datepickers by default show up empty, but I want to set the current date of the server as a default, that is whenever I add a new page both the date pickers should have the current date of the server by default in it.

In advance thanks for the help.

2 Answers
2

It depends on the datepicker plugin you are using. Mostly all datepickers will have a default value you can play with. Usualy it is set within the input text type that hosts the datepicker.

<input type="text" class="datepicker" default-value="2013/07/25">

And in wordpress’ php you can do :

<input type="text" class="datepicker" default-value="<?php echo date("Y/m/d"); ?>">

Leave a Reply

Your email address will not be published. Required fields are marked *