-
-
Save iamgaby7521/6911652 to your computer and use it in GitHub Desktop.
How to properly add jQuery scripts to WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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