I’m trying to enqueue a script after the combined Autoptomize JS but it never renders after, no matter how high a priority I set. I have seen this post but got lost trying figure out how to use the “return array”. Any chance you can elaborate a bit on the answer on how I use wp_register_script and wp_enqueue_script within or separate from that array?
Thanks so much 🙂
wp_register_script('custom', get_stylesheet_directory_uri(). '/js/script.js', false, false, true);
wp_enqueue_script('custom');
add_action( 'wp_enqueue_scripts', 'scripts', 99999999999 );