-
Hello,
I changed typography to host locally (to be in accordance with GDPR) however it takes a while before the font changes from default one to the one that is chosen. Is there any method to keep hosting font locally but make them load faster?
-
Hi there,
You can try preloading the fonts by adding the below HTML to a hook element, set the hook name to
wp_head
.Change the
href
andtype
to the actual ones:<link rel="preload" href="http://example.com/path/to/fonts/local-font1.woff2" as="font" type="font/woff2" crossorigin> <link rel="preload" href="http://example.com/path/to/fonts/local-font2.woff2" as="font" type="font/woff2" crossorigin>
-
Thank you. Intype should I use a font name, like below?
type=”poppins/woff2″ crossorigin>
-
Hi there,
no the type should remain as Ying provided. ie.
as="font" type="font/woff2" crossorigin>
But … before you do that.
In your Customizer > Additional CSS you have some other @font-face CSS, and ALL those fonts are returning a 404 Not Found error. I don’t think you need that CSS, so remove that so the browser does not waste time trying to load them. -
works well now, thank you very much
-
Glad to hear that!
- You must be logged in to reply to this topic.