wp主题自带的jquery版本比较低,兼容性强,但是很多时候我们不得不引入更高以及的js插件,就需要先禁用wp自带的jQuery插件,那么将下面的代码复制到function.php文件中

//禁止加载WP自带的jquery.js
add_action( 'pre_get_posts', 'jquery_register' );
function jquery_register() {
    wp_deregister_script( 'jquery' );
    wp_register_script( 'jquery', get_template_directory_uri() . '/static/js/jquery.min.js' , false, '1.1', false );
	wp_enqueue_script( 'jquery' );
}