CORS error happen when activate JSON API Plugin, that is required

[ad_1]

function add_cors_http_header(){
    header("Access-Control-Allow-Origin: *");
}
add_action('init','add_cors_http_header');

Add this code to your theme functions.php

Or

In the file located in wp-content/plugins/json-api/singletons/api.php, add following line:

    <? header("Access-Control-Allow-Origin: *"); ?>

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer