Loading Javascript Files
-
Hi.
I’m a little flustered with this, because I’d think I could figure this out on my own. But I’m having trouble getting Javascript loaded into a WordPress site. I’ve read up on using the “wp_enqueue_script” function to get jQuery loaded, and that seems to be woring alright.
What I can’t get working, is loading my specific Javascript file I need. I’m using the following after the “wp_head” function:
<script type="text/javascript" src="js/scripts.js"></script>
When I look at the loaded page’s source, it shows the script calling in jQuery, but doesn’t show the script calling in my specific “scripts.js” file. It’s not even a part of the page. I’ve tried inserting the “bloginfo(‘template_directory’)” in there as well:
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/scripts.js"></script>
What am I doing wrong?
This is the Javascript slider I’m trying to incorporate into my page: https://www.dreamcss.com/2009/04/create-beautiful-jquery-sliders.html
- The topic ‘Loading Javascript Files’ is closed to new replies.