0

I have looked over carefully at the scripts file for a WordPress plugin I am developing and I also looked at a similar post:

javascript file not working when linked from HTML

but the answer above has not worked either. I am not sure why the javascript file is not loading.

Here is the includes/newsletter-subscriber-scripts.php:

<?php

// Add Scripts
function ns_add_scripts(){
        wp_enqueue_style('ns-main-style', plugins_url().'/newsletter-subscriber/css/style.css');
        wp_enqueue_script('ns-main-script', plugins_url().'/newsletter-subscriber/js/main.js');
}

add_action('wp_enqueue_scripts', 'ns_add_scripts');

Here is the javascript file that is not loading in /newsletter-subscriber/js/main.js:

alert('Linked');
Daniel
  • 14,004
  • 16
  • 96
  • 156

1 Answers1

0

Did you check it out that its enqueuing in front end you can see script tag in your HTML output? of its coming than might be your browser java-script is off. check it or you can add link to your site so than someone can debug it

thank you

  • I didn't test it, but I think it had to do with the custom WordPress theme I was testing it with because when I tried the plugin on another custom WordPress theme I created it worked fine. – Daniel Dec 25 '16 at 07:16