Our wordpress site(s) is actually 2 in 1. That is, while they are separate host URLs on the same domain, same server, they run from the same set of wp code, but different databases. They are not multisite because a plugin we need was not compatible. Therefore, we are able to give the appearance of separate related sites, and they run on same wp-content/ but different databases.

We're running woocommerce and want to show a set of products in a category from one site, in the other.

So we have www.domain.com and store.domain.com. How can we show a category of products in www that is configured in store?

Thanks in advance, Mike


Since you're not currently running a multi-site install, you can either install the WP-REST-API plugin which is currently in beta, or you can wait for it to hit core which will probably be around version 4.3 or 4.4.

If you were on a multi-site install, you could have easily used the switch_to_blog() function to switch between blog databases to query databases.

WP Rest API Docs : http://wp-api.org/


  • Thanks Evan! DO you know of any plugins or libraries that help one to use the results of a REST api query and integrate the results with the existing site? IOW, once the queries are pulled, allow the results to be used in existing sites plugins (e.g. sliders)? – mcheck Jun 14 '15 at 15:19
  • You can parse the results of the response. I believe the results are returned in jSon. If you json_decode() the results, you should be able to store them in an array and then loop over them as you would a standard php array. – EHerman Jun 14 '15 at 19:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.