I'm facing a strange problem. After I've moved to another server, my wp_enqueue_script calls don't do anything. I do have this function:
function moemax_scripts() {
wp_enqueue_style( 'bootstrap-css', get_template_directory_uri() . '/lib/bootstrap/css/bootstrap.min.css' );
wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . '/lib/bootstrap/js/bootstrap.min.js', array(), '3.3.1', true );
wp_enqueue_script( 'main-js', get_template_directory_uri() . '/js/main.min.js', array(), array(), '1.0.0', true );
wp_enqueue_style( 'moemax-style', get_stylesheet_uri() );
wp_enqueue_script( 'moemax-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '1.0.0', true );
wp_enqueue_script( 'moemax-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '1.0.0', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
wp_enqueue_style( 'core-css', get_template_directory_uri() . '/css/core.min.css', false, '1.0.0' );
}
The strange thing is, all my css files get included, but none of the js files are added to the site. I tried to change $handle, $ver or even $src but nothing is happening. I don't get any errors in console.
main-js
has two array() declaration - which is wrong. It'd be helpful using the developer tool's "Console" while working with javascripts.wp_enqueue_style()
on the top, andwp_enqueue_script()
below them.