Skip to content

Instantly share code, notes, and snippets.

@iamgaby7521
Forked from tommcfarlin/jquery-boilerplate.js
Last active October 7, 2017 02:43
Show Gist options
  • Save iamgaby7521/6911652 to your computer and use it in GitHub Desktop.
Save iamgaby7521/6911652 to your computer and use it in GitHub Desktop.
How to properly add jQuery scripts to WordPress
// Loading scripts in footer
(function($) {
"use strict";
// example for document ready
$(document).ready(function() {
// Your code here
});
}(jQuery));
// Loading scripts in header
jQuery(document).ready(function($) {
$('.hideable').on('click', function() {
$(this).hide();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment