Include javascript file from other folders rather than default folder

I tried to include a javascript file from themes to plugin. In GeoLocationPlugin.php, I added:
queue_js_file(‘map’, ‘…/themes/seasons/javascripts’). I got “file not found” error. What is the correct way to include javascript file from another folder?

The theme system isn’t designed to work that way: you don’t give a path to a specific theme in these functions (because they’re designed to work seamlessly when you switch themes, which wouldn’t work if you’re hardcoding theme names).

If you’re just trying to override the Geolocation map.js file, the system will do that automatically as long as the file is in the right place in your theme: in this case, it should be at themes/seasons/geolocation/javascripts/map.js (and you want to restore the queue_js_file call to what it was originally).

Yes, my intention is to customize map.js. Thanks!

This topic was automatically closed 250 days after the last reply. New replies are no longer allowed.