I keep forgetting the syntax so this is just to remind me.
In WordPress you want to ensure you don’t get conflicts with jQuery so there is a safe way to code it
jQuery(function( $ ) {
// Your code using failsafe $ alias here...
});
And if you want it when the DOM is loaded then you can do it like this
jQuery( document ).ready(function($) {
// your code referencing $ here
});
Leave a Reply