Fix WordPress CORS Policy

I’ve had this error come up.

“… has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.”

To fix it, add this code to your .htaccess file:

<FilesMatch "\.(php|ttf|ttc|otf|eot|woff|woff2|font.css)$">
<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>