0

I am having a real problem with my javascript file not loading. I am working on a local environment using Vagrant. Git is recognizing every change I make to my javascript file but when I refresh the page the changes do not show up in the inspector. I am definitely editing the right file and I have dumped the cache a thousand times. Does anyone have any idea why this is happening? I've been working on this site everyday for a month and today is the first day this has started. Any help will be much appreciated.

I am adding the javascript file using:

    function wpb_adding_scripts() {
       wp_register_script('main', get_template_directory_uri().'/js/main.js', array('jquery'),'1.1', true);
       wp_enqueue_script('main');
}

add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' );
JordanBarber
  • 2,041
  • 5
  • 34
  • 62

1 Answers1

0

Solved this issue. For anyone who was having a day like I was yesterday...remember to do a wordpress database search and replace (I use this one https://interconnectit.com/products/search-and-replace-for-wordpress-databases/) on your local whenever you have to replace your local database with a testing/live database. Fist in forehead

JordanBarber
  • 2,041
  • 5
  • 34
  • 62