Tip: Adding jQuery Scripts to WordPress

I was just trying to add a simple font-resizer jQuery script to a WordPress theme.

This example seemed really simple but it just won’t work.

After a while, I stumbled on this page in WordPress Codex where it suggested replacing the jQuery shorthand – $ symbol with the word jQuery.

For eg:

$(document).ready(function () {

became

jQuery(document).ready(function () {

So, once I replaced all the ‘$’ symbol to jQuery, it worked flawlessly!

If your jQuery script is not working on your WordPress theme, make sure you check this.

Explore Tags: , ,

Comments are closed.