I know that before this question a question was asked that the “solutions” that I have found so far do not work.
I am using Contact Form 7 and the datepicker plugin on my Wordpress site. The contact form and calendar work very well, but I want to specify specific dates by changing the background color of these dates.
Here is the code that I included in my header file:
<script type="text/javascript"> $(document).ready(function() { var SelectedDates = {}; SelectedDates[new Date('07/26/2016')] = new Date('07/26/2016'); $('#datepicker123').datepicker({ beforeShowDay: function(date) { var Highlight = SelectedDates[date]; if (Highlight) { return [true, "Highlighted", Highlight]; } else { return [true, '', '']; } } });
});
In my stle.css sheet, I included the following code to add style to these dates:
.Highlighted a{ background-color : #1AAFFF !important; }
However, the date in this example (7/26/2016) does not stand out when I click on the calendar, but the standard style appears. Where is my mistake?
Many thanks for your help!
Edit: The HTML code seemed very long, so here's the link to the site: KYTE
Edit 2: So, I added the following code to the functions.php file:
function wpse_enqueue_datepicker() { // Load the datepicker script (pre-registered in WordPress). wp_enqueue_script( 'jquery-ui-datepicker' ); // You need styling for the datepicker. For simplicity I've linked to Google hosted jQuery UI CSS. wp_register_style( 'jquery-ui', 'http://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css' ); wp_enqueue_style( 'jquery-ui' );
} add_action ('wp_enqueue_scripts', 'wpse_enqueue_datepicker');
still not working.