In WordPress How to Use jquery and $ Sign

By default when you enqueue jQuery in WordPress you must use jQuery, and $ is not used (this is for compatibility with other libraries).

Your solution of wrapping it in function will work fine, or you can load jQuery some other way (but that’s probably not a good idea in WordPress).

If you must use document.ready, you can actually pass $ into the function call:

[sourcecode language=”plain”]jQuery(function ($) { …[/sourcecode]

[custom-related-posts title=”You may Also Like:” none_text=”None found” order_by=”title” order=”ASC”]

Leave a Comment