2012-07-05 3 views
0

난 그냥이 방법에서 테마에 내가 jQuery를 대기열 방식을 전환 :jquery가 WordPress 엔큐와 함께 작동하지 않는 이유는 무엇입니까?

이에
function my_init() { 
if (!is_admin()) { 
    // comment out the next two lines to load the local copy of jQuery 
    wp_deregister_script('jquery'); 
    wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', false, '1.7.2'); 
    wp_enqueue_script('jquery'); 
} 
} 
add_action('wp_enqueue_scripts', 'my_init'); 

: 버전에 내장 된 이전 버전 1.7.2를 사용

function my_scripts_method() { 
wp_enqueue_script('jquery'); 
} 
add_action('wp_enqueue_scripts', 'my_scripts_method'); 

function my_admin_scripts_method() { 
wp_enqueue_script('jquery'); 
} 
add_action('admin_enqueue_scripts', 'my_admin_scripts_method'); 

, 워드 프레스를 '1.7입니다. 1. 나는 1.7.1에 대한 주소를 첫 번째 버전으로 복사하여 붙여 넣으려고 시도했지만 똑같은 단점이있다. 링크가 1.7.1 버전의 소스에 있지만 jquery가 작동하지 않습니다. 어떤 아이디어가 이것을 일으킬 수 있습니까?

웹 사이트 URL : www.brainbuzzmedia.com/themes/vertex/

답변

0

I하지 정확히 문제가 여기에있다, 그러나이 시도 것. info 자세한 내용은

function wptuts_scripts_with_jquery() 
{ 
    // Register the script like this for a plugin: 
    wp_register_script('custom-script', plugins_url('/js/custom-script.js', __FILE__), array('jquery')); 
    // or 
    // Register the script like this for a theme: 
    wp_register_script('custom-script', get_template_directory_uri() . '/js/custom-script.js', array('jquery')); 

    // For either a plugin or a theme, you can then enqueue the script: 
    wp_enqueue_script('custom-script'); 
} 
add_action('wp_enqueue_scripts', 'wptuts_scripts_with_jquery'); 

...

0
function my_scripts_method() { 
if (!is_admin()) { 
    wp_enqueue_script('jquery'); 
} 
} 
add_action('wp_enqueue_scripts', 'my_scripts_method'); 

function my_admin_scripts_method() { 
// you don't need to load jquery here, because its automatically loaded in the adminby default 
} 
add_action('admin_enqueue_scripts', 'my_admin_scripts_method'); 
관련 문제