📜  wordpress 不加载 jquery - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:44.854000             🧑  作者: Mango

代码示例1
function include_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/libs/jquery/1.8.3/jquery.min.js', false, '1.8.3'); 
        wp_enqueue_script('jquery');
    }
}
add_action('init', 'include_jQuery');