If I use the full path to a script in the head section of my WordPress theme it works fine. E.g.:
<script src="http://www.mysite.com/wp-content-/theme/mytheme/js/script.js"></script>
However, if I use the ‘correct’ WordPress method it breaks, e.g.:
<?php wp_enqueue_script('kwicks-settings', get_template_directory_uri() . '/js/script.js'); ?>
When i use the wp_enqueue_script, the script appears linked to in the source code, but for some reason the script doesn’t run.
Any ideas why this might be?
You aren’t registering the script.
Register it:
Then Enqueue it: