Tag Archives: Access-Control-Allow-Origin

imgCodeWhat to do when your ionic cannot pull data from your wordpress with JSON ApI ?

This plugin provides a JSON format for the content that is in the wordpress. But

  1. You will need to go to  wp-content/themes/myTheme
  2. open functions.php
  3.  Add this    header(“Access-Control-Allow-Origin: *”); right after <?php




header(“Access-Control-Allow-Origin: *”);

II. solution 2

Some advice to modify directly the pluggin

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

Your choice.


  • Share :