SOLVED: Custom Fonts not working with WPML

Custom fonts are not working in a multi domain with WPML website. The fonts are only displaying in the main lenguage domain. It was working on 1.7.1.

I tried to regenerate css and flush cache but still not working.

Please, can someone help me?

Hi Pedro,
Thanks so much for your report, and welcome to the forum!

Can you provide me with a live link to so I can inspect the HTML/styles and some information about where/how you set the custom fonts (Theme Styles, specific elements, …)?

Best regards,
timmse

Sure, this is the main domain where the fonts are working fine: https://*****.es/, and *****.fr, *****.de and *****.eu are the other domains where the fonts are not showing.

Hey Pedro,
There are some CORS issues with the non-main domains. Please check the WordPress General Settings and see if HTTPS is set. Probably the URLs are still using HTTP, which causes the issues.

Thank you for your answer. As far as i know i have set https in all the domains, this is my configuration for the URLs in wordpress and WPML:

(Sorry for the language)

The weird thing is that it was working perfectly until patch 1.7.1

Would you be so kind as to send temporary login credentials and a link to this thread to help@bricksbuilder.io using the email address you used during the purchase?

I`ve sent you the email.

Hi Pedro,
It looks like you need to add the fonts for each language. I’ve just tried it by adding the font-family and the 800 weight to the german translation and now it shows correctly.

Technically, the custom fonts is nothing more or less than just a custom post type, that needs to be translated (using WPML).

Best regards,
timmse

But now the fonts are not working in spanish, its looks like that only work in the last language i uploaded the fonts

Arghh dammit, you’re right :slightly_frowning_face:
I’ll keep you updated. Please leave the login credentials active.

Edit: There seems to be a general problem with this: WPML custom fonts CORS - Google Search

Please look through the threads yourself, maybe one of the hints there will help. I’ll ask our developers in parallel.

It was that, thank you! I just added this line to my htacces and it worked:

# fix CORS error for fonts
<FilesMatch ".(eot|otf|ttf|woff|woff2)">
    Header always set Access-Control-Allow-Origin "*"
</FilesMatch>

PD: Did you change anything on my german domain? Because menu and some images are no rendering properly.

Yay! I’m glad you found an easy way to solve it :partying_face:
No, except for deactivating the translations for the custom fonts, I didn’t touch anything.