Is It Possible to add JS AFTER the Enqueue within the same Function?
The wp_add_inline_script() is designed for this purpose. It lets you add some inline JavaScript above or below an enqueued script. You just need to pass the contents of the script, without <script> tags: function custom_thing () { if ( is_page( 2138 ) ) { wp_enqueue_script( ‘external-script’, ‘http://domain.com/external/script.js’, array( ‘jquery’ ), 0, true ); wp_add_inline_script( ‘external-script’, … Read more