datepicker를 내 WordPress 템플릿 페이지의 양식에있는 사람에게 보내고 싶지만 작동하지 않습니다. 내가 페이지 mypage.php이를했습니다 그런 다음wordpress에서 jquery datepicker를 사용하십시오.
function modify_jquery() {
if (!is_admin()) {
// comment out the next two lines to load the local copy of jQuery
wp_deregister_script('jquery');
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js', false, '2.1.1');
wp_enqueue_script('jquery');
}
}
add_action('init', 'modify_jquery');
function load_jquery_ui_google_cdn() {
global $wp_scripts;
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('jquery-ui-slider');
// get the jquery ui object
$queryui = $wp_scripts->query('jquery-ui-core');
// load the jquery ui theme
$urlui = "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.8/jquery-ui.min.js";
wp_enqueue_style('jquery-ui-smoothness', $urlui, false, null);
}
add_action('wp_enqueue_scripts', 'load_jquery_ui_google_cdn');
:
<script>
$(function() {
$("#datepicker").datepicker();
});
</script>
...other code...
Date: <input type="text" id="datepicker">
...other code...
</form>
그러나이 표시되지 않습니다
이
내가 자식 테마의 functions.php를했습니다 코드입니다 . 무엇이 잘못되었는지 바람 날 수 있도록 도와 주시겠습니까?
에
참조하시기 바랍니다 자세한 내용은 (당신은'ajax.googleapis.com/ajax.googleapis.com'있다). 'datepicker()'를 어디에도 포함 시켰습니까? 나는 그것이 기본 jQuery가 아닌 jQuery UI의 일부라고 생각한다. – Hobo
@Hobo 답장을 보내 주셔서 감사합니다. 첫 번째 게시물에 표시된대로 jQueryi UI를 추가했지만 여전히 작동하지 않습니다. – testermaster