I have several wordpress sites installed in subfolders under a top level domain:
I need to load an AJAX file in each of them, and I've used the following code:
// Initiate asynchronous load of xml data: jQuery.ajax({ type: "GET", url: "/wp-content/themes/mytheme/data.xml", dataType: "xml", success: parseDataXML });
but that ends up searching for the file in the domain's root path:
http://www.mydomain.com/wp-content/themes/mytheme/data.xml
Instead of the site's root path:
http://www.mydomain.com/site-a/wp-content/themes/mytheme/data.xml
Get rid of the leading "/" in the url path. The leading slash means "from the root of the site", not "from my current folder".
Edit: Ok, then in the root index of each "site", you need to define BASE HREF to include that folder name. Then the leading slash should take into account that value instead of the site root.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With