تخطي الملاحة

Open

Topic Tags: Compatibility

Overview of the issue

When using Custom Fonts with Elementor and Different domains per language, a Cross-Origin Resource Sharing (CORS) Policy issue arises. The custom fonts are always loaded from the original domain, leading to CORS policy errors.

Workaround

  • Go to WPML > Settings > Post Types Translation
  • Set the post type Custom Fonts (elementor_font) to translate.
  • In the same page but in the Custom Fields Translation section, set the custom field elementor_font_files to translate.
  • Open your translation in ATE.
  • Search for ‘.ttf’ file.
  • Once you find it, translate the domain URL for the right one.
  • Go to Elementor > Tools.
  • Press the to Regenerate Files & Data button.
  • Clear browser cache.

6 ردود إلى “Elementor - Custom Fonts Cause CORS Policy Issue With Different Domains Per Language”

  1. You could also add the following to your .htaccess to get around this issue very easily:

    Header set Access-Control-Allow-Origin

    You could either allow every page to use it (bad idea)
    Header set Access-Control-Allow-Origin "*"

    Or you could just limit it to the domain of your translated page like this:
    Header set Access-Control-Allow-Origin "https://your-translated-domain.com"

    The .htaccess file should be in the root directory of your WP installation

ترك رد

يُرجى البقاء في الموضوع والتزام الاحترام للآخرين. إذا كنت بحاجة إلى مساعدة بشأن المشكلات التي لا تتعلق بهذا المنشور، فاستخدم منتدى الدعم لبدء محادثة أو إرسال تذكرة.

يمكنك استخدام هذه العلامات:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>