I have a wordpress multi-site implementation. I am a developing a custom plugin for this implementation. Is it possible to include a script based based on the site. if site is mydomain.com/uk :- script_uk.js need to be loaded if site is mydomain.com/us : - script_us.js need to be loaded.
1 Answer
Why don't you use simple Javascript/jQuery's function to check the url and enqueue the relevant js/css files? You may use the below js line to achieve your task:
if(window.location.href == 'YOUR_DESIRED_URL') {
// ENQUEUE JS 1
}
If you want to use php's function, you may also do that.