I have built a child theme out from the original parent theme. Having on completion learnt that it is standard industry practice to build a child theme (preferably from the start.) I have managed to convert 99.9% of the theme over to a child successfully however for some reason I cannot move one solitary js file (main.js) to my child assets folder. Images, style sheets , fonts etc.. have all been transferred to the child theme successfully however If I transfer the main. js file my parallax scroll (test) does not work. I am forced to leave this file by itself in its original parent folder location in order for this feature to work. Not ideal.
Tried every conceivable combination of enqueue, register and wpb_adding_scripts() functions I could find and nothing seems to work. This file only seems to work when left in its parent theme folder why is that?
NB. main.js shows as loading on my view page source but Still fails to work when the file is in my child theme…
h Any help appreciated
Thanks
bloginfo
unless absolutely necessary, the way it's being used here is only possible to keep backwards compat, modern WP code uses functions such asget_template_directory_uri()
, and use the enquing system WP provides rather than hardcoding the script tags. You're also loading 2 different copies of jQuery at the same time