douhan1992 2012-11-26 17:20 采纳率: 100%
浏览 49

<?php wp_head(); ?>打破页面上的所有jquery滑块

Here is the test server I am working on:

http://www.astwood.co.uk/testsite/wordpress/

I have set up two sliders using liquidSlider (a responsive fork of coda slider) in two of the three red boxes. That break when I put the

<?php wp_head(); ?>

hook in the

<head>

tag.

Can anyone take a look and see if they can shine some light on why?

Thanks in advance.

  • 写回答

1条回答 默认 最新

  • dongni3854 2012-11-26 22:39
    关注

    You've got two instances of the jQuery script on the page! This can create a lot of conflicts and confusion. Either you or one of your plugins is linking to jQuery without using the proper wp_enqueue_script function.

    I'm gonna go ahead and point the finger at Advanced Ajax Page Loader. Try deactivating that plugin and see if your sliders start working. I've looked into it, and that plugin actually does a decent job of enqueueing the script:

    function enqueue_AAPL() {
        //Make sure we use latest jquery?
        wp_deregister_script('jquery');
        wp_register_script('jquery', plugins_url( 'jquery.js' , __FILE__ ));
        wp_enqueue_script('jquery');
    }
    

    So my guess is that you've included <script type="text/javascript" src="http://www.astwood.co.uk/testsite/wordpress/wp-content/themes/AstwoodV3/js/jquery-1.8.2.min.js"></script> somewhere in your header file. Find it, take it out. Then make sure you're enqueueing all your scripts (like jQueryUI, fancybox, liquid-slider, jquery.tweet, etc.) keeping in mind the dependencies parameter

    评论

报告相同问题?

悬赏问题

  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)