TypeError: $ is not a function WordPress

user1645326 picture user1645326 · Sep 4, 2012 · Viewed 131k times · Source

I might have an error in a .js document in a theme I have purchase:

$('.tagcloud a').wrap('<span class="st_tag" />');

I am trying to solve it but I am not a programmer so I don't know how. The site is this: http://www.framerental.com .

Answer

jurka picture jurka · Sep 4, 2012

You use jQuery.noConflict(); So $ is undefined.

You can read more about it here docs

Try to modify your code in this way (add $ sign to ready function):

jQuery(document).ready(function($) {
    // Code that uses jQuery's $ can follow here.
});