Hi,
I’m trying to fix this issue that google pagespeed reports (and others). However couldn’t so far find some easy fix for it and also why it loads those stuff.
Error:
https://freeimage.host/i/HCveBqX
Fonts mentioned there:
https://fonts.gstatic.com/s/opensans/v34/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTS-mu0SC55I.woff2
https://fonts.gstatic.com/s/opensans/v34/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTSGmu0SC55K5gw.woff2
.PRIVATEURL.sk/wp-content/themes/enfold/config-templatebuilder/avia-template-builder/assets/fonts/entypo-fontello.woff2
PRIVATEURL.sk/wp-content/uploads/avia_fonts/type_fonts/static/cabin_semicondensed-semibold.ttf
The fonts I configured in Enfold are:
– Open Sans
– Cabin (locally uploaded)
I’m not sure where entypo-fontello comes from.
Is there some simple fix how to prevent this “issue” to be reported? Is there some best practive for fonts management or some function I need to use to make this dissapear?
Thanks
Jaro
Hey Jaro,
Thank you for the inquiry.
Adding this filter in the functions.php file should help.
add_filter('avf_font_display', function($swap) {
return 'swap';
}, 10, 1);
The filter should set the font-display property from block to swap.
Best regards,
Ismael
Thanks Ismael,
It seems this option is also available in Performance tab of Enfold under advanced. I’ve set it there now.
Feel free to close this one.
Hi,
It seems this option is also available in Performance tab of Enfold under advanced
Ah, yes, completely forgot about that option. Yes, you can adjust the font-display value there but the filter above should accomplish the same. Please feel free to open another thread if you have more questions.
Have a nice day.
Best regards,
Ismael