title: Jquery set interval not working in wordpress
body: <p>The anchors in the span tag should change every 5 seconds but nothing happens.
  I've tested that jQuery works in WordPress with <code>alert("test");</code> at the top of my js file.</p>
  
  <pre><code>    &lt;div class="img_ad"&gt;&lt;span&gt;&lt;a class="active"&gt;&lt;img src="http://www.test.co.uk/wp-content/uploads/2014/10/client3.png" /&gt;&lt;/a&gt;
      &lt;a&gt;&lt;img src="http://www.test.co.uk/wp-content/uploads/2014/10/client1.png" /&gt;&lt;/a&gt;
      &lt;a&gt;&lt;img src="http://www.test.co.uk/wp-content/uploads/2014/10/client2.png" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>-</p>
  
  <pre><code>jQuery(document).ready(function($) {
  
  
    function swapImages(){
        var $active = $('.img_ad').find("span:first").find(".active");
        var $next = ($('.img_ad').find("span:first").find('.active').next().length &gt; 0) ? $('.img_ad').find("span:first").find('.active').next() : $('.img_ad').find("span:first").find('a:first');
        $active.fadeOut(function(){
        $active.removeClass('active');
        $next.fadeIn().addClass('active');
        });
      }
  
       // Run our swapImages() function every 5secs
        setInterval('swapImages()', 5000);
  
  
  });
  </code></pre>
  
  <p>This code doesn't work, i put <code>alert("test");</code> in the function swapImages() but nothing happens.  I think setInterval is not working.  How do i solve this?</p>