Bootstrap carousel start on load with wordpress

I have used twitter bootstrap on handbuilt sites and could get the carousel to start cycling on load. However, I am using a wordpress theme and can’t for the life of me figure out how to get this to start cycling. Carousel works but wont cycle on load

http://drdavidpier.koding.com/lauras-wordpress/

Read More

I have tried adding in various bits of script related to the carousel(‘cycle’) and interval methods from the bootstrap docs but nothing seems to change.

If you can help me on this please let me know where I should amend/add any script.

Thanks in advance!

Related posts

Leave a Reply

2 comments

  1. This should do the job:

    jQuery('#myCarousel').carousel({
      interval: 2000
    })
    

    But I’ve noticed that ready event isn’t working for you and code doesn’t get executed. Please try to replace your scripts.js code with this and tell me if it’s working.

    edit:

    Basically what I did was replacing $ with jQuery and some change of code structure.

  2. The reason it’s that on your website something is conflicting with jQuery. In your script change the line:

    $(document).ready(function() { // your stuff })
    

    to:

    jQuery(document).ready(function($) {  // your stuff })
    

    (note the $ sign as parameter in the second one).
    in this way you will be able to keep all the $ sign in your scrips, without manually change all of them.

    Another solution, if you prefer, but is to change all your $ to jQuery.