Using ‘$’ instead of ‘jQuery’ in WordPress

Using a self invoking anonymous function that passes the jQuery object will do the trick:

(function($){ 
   $(window).load(function(){
     $('#myid').css({'background': 'black', 'color':'white'});
   });
})(jQuery); //Passing the jQuery object as a first argument

Leave a Comment