2012-06-11 3 views
0

저는 곧 jQuery UI (코어 및 효과, CSS 포함 안함) (http://hildasjcr.org.uk)가 곧 필요할 WordPress 테마를 만들고 있습니다. jQuery Effects를 사용해야하고 "$"표기법을 좋아하기 때문에 jQuery와 jQuery UI의 빌드를 사용하고 있습니다. 나는이 같은 functions.php에서 스크립트를 포함 한 다음 HTML 코드를 제공Wordpress - jQuery UI가로드되지 않습니다.

function my_scripts_method() { 
    wp_deregister_script('jquery'); 
    wp_register_script('jquery', get_template_directory_uri() . "/js/jquery-1.7.2.min.js"); 
    wp_enqueue_script('jquery'); 
    wp_deregister_script('jqueryui'); 
    wp_register_script('jqueryui', get_template_directory_uri() . "/js/jquery-ui-1.8.21.custom.min.js"); 
    wp_enqueue_script('jqueryui'); 
    wp_register_script('footer', get_template_directory_uri() . "/js/footer.js"); 
    wp_enqueue_script('footer'); 
} 

add_action('wp_enqueue_scripts', 'my_scripts_method'); 

(관련 비트를 제거) :

<!DOCTYPE html> 
<html dir="ltr" lang="en-US"> 
<head> 
    <meta charset="UTF-8" /> 
    <title>Current Students</title> 
    <link rel="stylesheet" type="text/css" media="all" href="http://hildasjcr.org.uk/wp-content/themes/hildas/style.css" /> 
    <script type='text/javascript' src='http://hildasjcr.org.uk/wp-content/themes/hildas/js/jquery-1.7.2.min.js?ver=3.3.2'></script> 
    <script type='text/javascript' src='http://hildasjcr.org.uk/wp-content/themes/hildas/js/jquery-ui-1.8.21.custom.min.js?ver=3.3.2'></script> 
    <script type='text/javascript' src='http://hildasjcr.org.uk/wp-content/themes/hildas/js/footer.js?ver=3.3.2'></script> 
</head> 

불행히도, jQuery를 UI로드 보이지만입니다 사용할 수 없습니다 - jQuery는 정상적으로 실행되지만 jQuery UI 함수는 모두 정의되지 않습니다.

Chrome의 개발자 도구 패널에 jQuery UI가 표시되며 여기에 코드가 있습니다.

그래서 잘못 되었나요? 어떻게 수정합니까?

+0

jQuery를 사용 하시겠습니까? 그리고 내용이로드 된 후에'$ (selector) .tabs()'메서드를 호출하고 있습니까? – Johan

+0

핵심 및 효과 - CSS가 포함되어 있지 않습니다. – TDN169

+0

도움이 될 수 있습니다. http://stackoverflow.com/questions/6125928/jquery-ui-dialog-stopped-working-gives-error-cannot-call-method-mouseover-o – Johan

답변

1

문제는 페이지의 기초가 된 HTML5 Boilerplate에서 발생했습니다. 두 번째로 jQuery가 바닥 글에 포함되었으며 jQuery의 두 인스턴스는 서로를 좋아하지 않았습니다.

관련 문제