Add option to enqueue custom.js in footer
-
Hi,
I enqueue my theme scripts in the footer and custom.js is set to load in the header, before my jQuery kicks in. It would be nice if this plugin gave an option to enqueue the JS in the footer or header. For now I’ve had to use this code, maybe it’ll help someone else:
add_filter( ‘wp_enqueue_scripts’, ‘preface_enqueue_email_encoder_script’, 1 );
function preface_enqueue_email_encoder_script() {
wp_dequeue_script( ‘eeb-js-frontend’ );
wp_enqueue_script( ‘eeb-js-frontend’, WP_PLUGIN_URL . ‘/email-encoder-bundle/core/includes/assets/js/custom.js’, array( ‘jquery’ ), ”, true );
}
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Add option to enqueue custom.js in footer’ is closed to new replies.