Last Updated: February 25, 2016
·
747
· hi_dm

Write jQuery normally within WordPress

By default, WordPress' built-in jQuery library comes in "no-conflict" mode. This requires inline jQuery to use "jQuery" everywhere you would normally use "$".

A simple workaround:

jQuery(document).ready(function($){

    $('normal-jquery-here');

});

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

WordPress sites collect scripts from themes, plugins, and tag managers. A compromised plugin update can add a skimmer to every page without a change in your own templates.

Security insights from Cside