Running jQuery code after deferred loading jQuery Library in WordPress
First, register, then enqueue your JS script file in your /wp-content/themes/<your theme>/functions.php. In the following example, I’m registering a file called global.js. This file will hold your new jQuery code. In your .js file, in my example I’m calling it global.js; use the function: