Your jQuery code is error free, everything should be running fine in your WordPress website, but it isn’t! You have noticed the “$ is not a function” error in your console. The problem isn’t your code, its the combination of both jQuery and WordPress (more specifically prototype). Luckily its a quick fix, albeit tedious for alot of code.
The Fix
As previously mentioned the fix is actually quite simple. Just replace your ‘$’ variable with ‘jQuery. This is known as Aliasing the jQuery namespace” See the example below.
Before:
$(document).ready(function () {
$("p").text("Your Code");
});
After:
jQuery(document).ready(function () {
jQuery("p").text("Your Code");
});

Follow Us: