Why is my JS file not being added into the footer?
-
Hi,
I’m new to WP (at least, tweaking the plugin side of things).
I’ve so far managed to tweak a plugin to do what I want… but now I want to put the fancybox CSS/JS files into the correct <head> and footer sections.
In ThreeSixtySlider.php, I have this default function:
function show() { if ( $this->imagesCount > 1 ) { require 'views/slider.php'; } }
..my tweaked version looks like so:
function show() { if ( $this->imagesCount > 1 ) { $GLOBALS['show360Thumb'] = 1; function test() { //wp_register_script( 'custom-script', plugins_url( '/js/test.js', __FILE__ ) ); wp_register_script('jqueryssss', 'https://test.com/foo.js', array(), '1.5.1', true); } add_action( 'wp_enqueue_scripts', 'test' ); require 'views/slider.php'; } }
I know this function is being called… but it never adds the JS file into the footer.
I’m assuming it has something to do with how I’m invoking it (I’m a Perl programmer mainly, and only really install and do basic stuff with WP – but I’m now trying to move a bit more into WP work as well)
On another note… does anyone have a suggestion on a good WP book I can read? (regarding development)
Thanks!
Andy
- The topic ‘Why is my JS file not being added into the footer?’ is closed to new replies.