I have this WordPress site with a plugin called JSON API. This plugin provides a JSON format for the content that is in the WordPress. I was able to enable CORS on the WordPress by adding header("Access-Control-Allow-Origin: *"); on the PHP header. But when I tried the URL that the JSON API plugin provides, the CORS does not work anymore.
This is the WordPress site were I'm doing the tests. I used the test CORS website to check if it was working and it is. http://kiwa-app.loading.net/
But when I try with the URL that the JSON API provides me, it is not working anymore. I still have the error No 'Access-Control-Allow-Origin' http://kiwa-app.loading.net/?json=info
Ok I finally figured out an easy way...
You just have to add:
<? header("Access-Control-Allow-Origin: *"); ?>
On the file api.php, this file is located in wp-content/plugins/json-api/singletons/api.php
I hope it helps more people with the same problem!