How do you have the multilingual site setup? With Multisite, or a plugin like WPML?
Thread Starter
w-sky
(@w-sky)
Hello @daanvandenbergh
Yes I forgot to mention: We are using WPML with seperate domain setting.
Main language German is https://co2-pos.de/ and second language English is https://co2-pos.com/
OMGF is active now and you can observe on our site: .de is alright, Google font used but not loaded from Google. .com will be either shown with a default font, or will be shown with the Google Font but loaded from Google. So OMGF is not fully working on the second domain.
(EDIT: I have noticed that the behavior can be different if using Firefox or a Chrome based browser and reloading the page several times.)
Thread Starter
w-sky
(@w-sky)
Now it’s too late to edit my text above again. But I realized that I was wrong on one point: No Google Font is now displayed on the second domain, regardless of which browser or how often you reload. The fact that I could sometimes still see the Google Font beforehand was because it was still in the cache.
Now how can I get OMGF working on our WPML multilingual site with different domains? By looking at sources on co2-pos.com with browser inspector, I can see that a font from co2-pos.de is loaded but still the page displays with a default font.
Hi!
OMGF isn’t compatible in that manner with WPML. At this point, it can’t distinguish between different domains when WPML is used.
What you could do, however, is: setup your server’s CORS configuration to allow requests from one domain to the other. In other words: co2-pos.com should be able to make requests from co2-pos.de.
Ideally OMGF should be able to write a separate stylesheet for each of the domains configured in WPML, but that’s in a work in progress at this point. Reconfiguring your server’s CORS related settings should resolve the issues you’re having.
Thread Starter
w-sky
(@w-sky)
Hello Daan, thanks for checking this out. I am using a managed server and can’t see anything about CORS in the server settings which are accessible to me, however I can ask the support if it’s possible to edit the CORS configuration.
I can set the root folder for the second domain (which is: same root folder for both domains). I do have access to the allow_url_fopen
and allow_url_include
settings, will that help?
Hmmm, CORS is configered at server level, when running on Apache it would be in your apache2.conf file. Running Nginx it’d be in a server
block somewhere in your /etc/nginx
directory.
In short, yes, I think you should contact support to ask if they can enable it for you 🙂