wp_enqueue_script | Help me figure out what is causing jQuery is not defined

I am using the function.php files wp_enqueue_script function to load in my .js files.

However even though I believe I load jQuery before the slick.js. Slick returns an error in my console ‘jQuery is not defined’ in slick.min.js. All documents exist and are in the correct location.

function hubble_space_scripts() {
wp_deregister_script(‘jquery’);
wp_enqueue_script(‘custom-jquery’, get_template_directory_uri() . ‘/js/jquery-3-4-1.js’, array(), null, true);
wp_enqueue_script(‘slick-scripts’, get_template_directory_uri() . ‘/js/slick.js’, array(), null, true);

wp_enqueue_script( ‘hubble-space-navigation’, get_template_directory_uri() . ‘/js/navigation.js’, array(), ‘20151215’, true );
wp_enqueue_script( ‘hubble-space-skip-link-focus-fix’, get_template_directory_uri() . ‘/js/skip-link-focus-fix.js’, array(), ‘20151215’, true );
wp_enqueue_script(‘pretty-photo-scripts’, get_template_directory_uri() . ‘/js/pretty-photo.js’, array(), null, true);
wp_enqueue_script( ‘hubble-space-theme-script’, get_template_directory_uri() . ‘/js/hubble-space.min.js’, array(), ‘20151215’, true );
wp_enqueue_script(‘ajax-pagination-scripts’, get_template_directory_uri() . ‘/js/ajax-pagination.js’, array(), null, true);
wp_enqueue_script(‘footer-scripts’, get_template_directory_uri() . ‘/js/footer-scripts.js’, array(), null, true);
}
add_action(‘wp_enqueue_scripts’, ‘hubble_space_scripts’);

Why is this happening? If you could let me know the parts I can copy into my question that are relevant I am happy to provide further resources. Not sure how complex the answer to this question is yet.

Thank you to all contributors, Jason.

Read more here:: wp_enqueue_script | Help me figure out what is causing jQuery is not defined

Leave a Reply

Your email address will not be published. Required fields are marked *