wp_register_script('SliderViewer', '/js/SliderViewer-1.2.js');
wp_enqueue_script('SliderViewer');
get_header();
however, mydomain.com/js/SliderViewer-1.2.js
doesn’t exist.
My js is in the ftp at
thewebsite -> wp-content -> themes -> BLANK-Theme -> js
What’s the path of that? Thanks-
You’re registering/enqueueing your script wrong. You should register/enqueue in your theme’s
functions.php
file instead of inside the header/page.Also, you need to use your theme’s directory … which will be along the lines of
mydomain.com/wp-content/themes/BLANK-Theme/js/SliderViewer-1.2.js
.Use this code in
functions.php
:This will enqueue and register your script, and ensure that you’re using the appropriate directory for your theme in the process.