Skip to content

Instantly share code, notes, and snippets.

@tommcfarlin
Created March 7, 2013 16:12
  • Star 33 You must be signed in to star a gist
  • Fork 17 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tommcfarlin/5109167 to your computer and use it in GitHub Desktop.
[WordPress] Properly loading jQuery within WordPress without having to use the `noConflict` method, or creating your own reference such as `$wp = jQuery`.
/**
* This gist demonstrates how to properly load jQuery within the context of WordPress-targeted JavaScript so that you don't
* have to worry about using things such as `noConflict` or creating your own reference to the jQuery function.
*
* @version 1.0
*/
(function( $ ) {
"use strict";
$(function() {
// Your code here
});
}(jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment