Jquery冲突wordpress

时间:2015-03-27 07:58:41

标签: javascript jquery wordpress conflict conflicting-libraries

我不知道为什么所有基于Jquery的插件在我的wordpress主题中都无法正常工作。例如,切换插件或dw问题。

这是我在主题中连接脚本的方式:

标题

<?php wp_enqueue_script("jquery"); ?>
<?php wp_head(); ?>

在功能中:

add_action('wp_enqueue_scripts', 'no_more_jquery');

function no_more_jquery(){
wp_deregister_script('jquery');
wp_register_script('jquery', "http" . 
($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . 
"://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js", false, null);
wp_enqueue_script('jquery');

if ( !is_admin() ) {
function easing()
{

 wp_register_script( 'jquery_easing', get_template_directory_uri() . '/js/jquery.easing.1.3.js', array( 'jquery' ) );

wp_enqueue_script( 'jquery_easing' );
}
add_action( 'wp_enqueue_scripts', 'easing' );
function camera()
{
// Register the script like this for a theme:
wp_register_script( 'camera_min', get_template_directory_uri() . '/js/camera.min.js', array( 'jquery' ) );

wp_enqueue_script( 'camera_min' );
}
add_action( 'wp_enqueue_scripts', 'camera' );
function jquery_ui()
{

wp_register_script( 'jquery_ui-script', get_template_directory_uri() . '/js/jquery-ui-1.9.0.custom.min.js', array( 'jquery' ) );

wp_enqueue_script( 'jquery_ui-script' );
}
add_action( 'wp_enqueue_scripts', 'jquery_ui' );
function fadeSlideShow()
{
// Register the script like this for a theme:
wp_register_script( 'fadeSlideShow-script', get_template_directory_uri() . '/js/fadeSlideShow.js', array( 'jquery' ) );

wp_enqueue_script( 'fadeSlideShow-script' );
}
add_action( 'wp_enqueue_scripts', 'fadeSlideShow' );
}
}

0 个答案:

没有答案