Where intelligence is put to the test.

wp_enqueue_script(), jQuery, and WordPress

John Crenshaw in wordpress

Oct 16

jQuery and WordPress

A quick note on using jQuery with WordPress for those having any trouble with it. I decided to use wp_enqueue_script() to include the jQuery library in a recent project and discovered the jQuery code wouldn’t do anything.

After a bit of searching, I discovered the solution was to replace all the “$()” in my jQuery code with “jQuery()”.

Apparently, in order to prevent collisions with the Prototype javascript framework, which also uses “$()”, you have to use jQuery() instead of $() for all your jQuery functions to work with wp_eneque_script().

Ready to talk? We’re listening.

If you have questions we have answers. And probably some questions for you, too.

Let’s get after it!

Let's Get Started