How To Call WP_Query From A Subdomain?


I have a PHP script running in WordPress, that uses a WP_Query to get the posts from one of my subdomains and return it as a JSON string. The script only receives the post data if I call it using the correct subdomain.

For example, if I go to, the JSON prints correctly, but if I go to it only prints an empty array.

How can I call a single script that will get data from a subdomain, even if I call it using the main domain? Or even better, if I call it from any subdomain?

, Bryan 8 years 2016-03-29T13:33:08-05:00 0 Answers 92 views 0

Leave an answer