I’ve been using ACF for a while now and I always seem to run into the same problems… “Uncaught ReferenceError: acf is not defined”… I have seen a few fixes before that worked for me but they were for older versions of the plugin and since then, the files have changed in the plugin (as in filenames, folder names, structures etc).
I use a plugin called Unyson Page Builder too because it’s easy to edit the website for my customers and it’s built off Bootstrap Framework which always helps!
When I go to edit a page it screws up… Example: http://prntscr.com/m3ovvi (there should be a blue button next to Add Media saying Default Editor) as you can switch between the WP default editor and Unyson.
The odd thing is, sometimes I’ll refresh the page and it’ll all work normally and have no errors but then I refresh again and the problem comes back… Like, huh?
I’m not sure if it’s something to do with where I’m caling my jquery files in the theme or not but I’ve tried changing where I’m calling it to try and call jquery before ACF stuff etc but I’m at a dead end and it’s just making it so much more of a pain in the arse to try and edit the website…
everything you describe point to a problem with your jquery, as you already suspected.
jquery is accessing the websites DOM. if the DOM is not finished with loading, jquery will fail. this is why is sometimes workes. it means that sometimes the DOM is loaded in time, sometimes it takes split seconds longer and jquery wont find anything.
solution is: make sure jquery is executed after the DOM is loaded.
A: I want to build a house. Can you tell me an idea of cost? B: Awesome! Well there are many factors that go into building a house. Do you have any other details? A: I really just want a rough idea of the cost.
This isn't how you would build a house.....or a website.