0

I want to add the below snippet to my wordpress installation.

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

I don't want to add it in every template header as there are many of them and I have 60 networks with 2-3 sites in each network. In what file should I add this snippet so that it has effect across the entire wordpress installation?

  • Any update on this? – atwellpub May 28 '14 at 22:58
2

I would prefer to do this at web server level.

If you are on NGINX server, you can use in your site conf file:

add_header Access-Control-Allow-Origin *;

If you are on Apache server, you can use in your .htaccess:

Header set Access-Control-Allow-Origin "*"

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.