0
由於某些原因,我的jQuery腳本似乎只在登錄到WordPress時才加載。這裏是頁面: http://www.mcfaddengavender.net/newmg/僅當登錄到WP時jQuery才起作用
正如你所看到的,圖像不是「滑動」英寸然而,如果我登錄並返回到主頁,事情工作正常。下面是我使用jQuery的運行中的代碼的functions.php:
//jQuery - Use Google CDN instead of WP jQuery
function my_scripts_method() {
if (!is_admin()) {
wp_deregister_script('jquery');
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js');
wp_enqueue_script('jquery');
}
}
add_action('init', 'my_scripts_method');
?>
任何想法什麼會導致這樣一個奇怪的問題?