How to Run a jQuery Script after a Javascript Script has Finished in WordPress
To accomplish this, wrap wp_enqueue_script in a function and run it through the action hook wp_enqueue_scripts while using the ‘priority’ parameter available in add_action to set the load order. function these_go_first() { wp_enqueue_script(‘first_script’, ‘[path to file]/first.js’, array(‘jquery’), ‘1.0’ ); } function these_go_first() { wp_enqueue_script(‘after_script’, ‘[path to file]/after.js’, array(‘jquery’, ‘first_script’), ‘1.0’ ); } add_action(‘wp_enqueue_scripts’, ‘these_go_first’, 1); … Read more