0
我想在Wordpress(版本4.3.1)中的我自己的主題中實現日期選擇器。可惜沒有成功。我認爲一個問題是,我有一個SSL證書。Wordpress中的日期選擇器自己的主題
我的functions.php
function datep_scripts() {
wp_enqueue_script('jquery');
wp_enqueue_script('jquery-ui-datepicker', array('jquery'));
wp_register_style('bootstrap_css', get_template_directory_uri() . '/bootstrap/css/bootstrap.min.css');
wp_enqueue_style('bootstrap_css');
wp_register_style('jquery-ui', get_template_directory_uri() .'/js/jquery-ui.css');
wp_enqueue_style('jquery-ui');
}
add_action('wp_enqueue_scripts', 'datep_scripts');
我page.php文件
<input type='text' name="event_date" id="EventDate" class="form-control input-lg"/>
....
<script type="text/javascript">
//show calendar windows
jQuery(document).ready(function() {
jQuery('#EventDate').datepicker({
dateFormat : 'dd.mm.yy'
});
});
</script>
我總是得到錯誤信息:
ReferenceError: jQuery is not defined
沒有任何人有同樣的問題?
Greets,yab86
謝謝Rohit。我在上面添加了我的代碼。 – yab86