Support » Plugin: Use Any Font | Custom Font Uploader » CORS header Access-Control-Allow-Origin missing for website users

  • Resolved userwhosme

    (@userwhosme)


    Hey everyone,

    I’m adding a font using Use Any Font plugin and, despite adding a CORS header with the * wildcard to my website in my child theme’s functions.php file, people visiting the website still get the error for the missing CORS header. It works fine if I visit the website URL (live production site, *not* localhost) on my own computer in any browser, but every single other person accessing the site on their computers get the CORS error. Any ideas how to fix this?

    Thanks in advance! 🙂

    Sincerely,
    userwhosme

    CORS header in functions.php:

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

    Errors in the user’s console: https://snipboard.io/1nzCd9.jpg

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.