Skip to content

Instantly share code, notes, and snippets.

@azizultex
Last active May 23, 2021 00:58
Show Gist options
  • Save azizultex/ac5bea58d5b6b74fb464 to your computer and use it in GitHub Desktop.
Save azizultex/ac5bea58d5b6b74fb464 to your computer and use it in GitHub Desktop.
jQuery Syntax for Wordpress
// jquery shorthand
$(function(){
// jQuery methods go here...
});
// writing jQuery in WordPress
(function($) {
// Your jQuery code here, using the $
})(jQuery);
jQuery(function($){
// Your jQuery code here, using the $
});
// If you absolutely need to load the scripts in the header, you should use below syntax
jQuery(document).ready(function($) {
// Your jQuery code here, using the $
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment