-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Major issue - Kirki Fonts not working (woff files not being rendered) #2524
Comments
Same issue there |
Not sure if I'm having the same issue or just a similar one. I do also get directed to a /font instead of a .woff file, but no content type is identified. I'm using a combination of Spartan regular and Spartan 800. When I use Spartan 500 instead of regular, it works fine. When using regular, 800 ain't working either. |
I have several themes which are dependant on Kirki typography facing the same issue. Can we please expect a patch release on this major issue? |
Exactly same here. No google font set through Kirki is working, irrespective of font variant etc. @font-face { Appreciate your help. |
I guess that's why I can't load the Outfit font. |
@simontomkins Can we have issue title edited to something like --- Google Fonts Or Kirki Fonts not loading/working? |
It seems like a quick fix for this issue is to change the user agent as suggested above:
Then delete the
Then everything should work using .woff2 files instead of .woff files - at least until Google changes something again... |
Thanks for the solution. |
Thanks for the solution. We had the exact same issue with the popular Poppins font. The interim solution outlined above fixed it too. Step by step1. In: /plugins/kirki/kirki-packages/module-webfonts/src/Webfonts/Downloader.php Commented out line 186: Added line: 2. In: Wordpress backend. Installed plugin: 'Transients Manager' and activated it on affected websites in the Wordpress Multisite. 3. In Wordpress backend. Went to: Tools > Transients. Searched for: kirki. Deleted: kirki_remote_url_contents |
When are they going to fix it |
Can we expect an Update soon? our multiple websites are Affected. |
Please update the plugin 🙏 |
Which Plugin? |
Hey there, David here, former owner of Kirki. I've pinged the Themeum team about this. Hope we'll get a fix for this soon! |
Same issue there with my WordPress themes from themeforest |
This works for my sites. STEP BY STEP
Wordpress admin option (copy and paste on your browser): /wp-admin/plugin-editor.php?file=kirki%2Fkirki-packages%2Fmodule-webfonts%2Fsrc%2FWebfonts%2FDownloader.php&plugin=kirki%2Fkirki.php FTP Option: /plugins/kirki/kirki-packages/module-webfonts/src/Webfonts/Downloader.php
Commented out line 186: Added line:
Wordpress admin option (copy and paste on your browser): Notice: Take care with your customs fonts on this folder: /wp-content/fonts/ kirki will delete and download all fonts again so, your custom fonts in this folder will delete by kirki, recomendation is upload your custom fonts on your own folder in your child theme. /wp-admin/options-general.php?page=kirki_settings and clear cache (if you are using other aditional option for cache, clear it after kirki cache) And all fonts will be works! This works for all our sites, I hope this fix you fonts issue. Bye. |
The annoying thing about the kirki transients and the easy flush option {domain.com}/wp-admin/options-general.php?page=kirki_settings is that it doesn't clear the most important one in cases like this, which is the host path to the fonts. If anyone needs to find that, to remove it, in their mysql, here's the gist:
|
I notice that some of the comments seem confused about how to get woff2 fonts working. If you're experiencing this issue and trying to change the user agent to get woff2 fonts, you also need to delete the transient You can delete the transient using the (WP-CLI) command I listed above, or, if you aren't able to run the command, you might be able to delete it using the Transients Manager plugin that was suggested here. Or you can wait until the transient expires on its own - but that may take up to 7 days. |
Thanks for the tip :3 Works like a charm now |
Hello, Thank you all for the solution that solved my problem. I hope the extension developers will update their extension. |
To fix the issue faster on all our websites we composed a simple plugin that can fix this. Download here. |
Thanks a lot but a native update would be better |
There was update for Kirki released 2 hours ago, seems they have fixed that, thanks! |
The google font list needs update. Some fonts are not downloaded. Example: It makes only ../fonts/font file without downloading the font. Update the font list please. |
There is no mention of a fix in their changelog |
The 5.1.0 update does not seem to fix the font loading issues, fonts are still not loading correctly on any of my sites using the latest version |
Same situation 😔 |
Clean transients |
Thanks, this is working |
How do you clean transients mentioned above for that kirki_remote_url_contents piece? |
Here is the solution , you just need to install the plugin and wait for the update |
Malheureusement ça n'a pas fonctionné chez moi. Je l'ai installé et ça a eu l'air de fonctionner (les polices sont redevenues normales) puis impossible d'ouvrir mes sites (j'ai des codes css qui s'affichent à la place de la page d'accueil). Unfortunately it didn't work for me. I installed it and it seemed to work (the policies are normal income) then impossible to open my sites (I have css codes which are displayed instead of the home page) . |
Unfortunately, this seems to be more of a server issue. If you need assistance from a professional, you can reach out to us via email [email protected] . Good luck. |
The change of user agent here is at best a bandaid, and technically makes Kirki less backwards-compatible with browsers that don't support woff2, but that's only somewhere around 2.42% these days The real issue is that Kirki is always expecting
Whereas the changed behaviour from Google sometimes returns URLs like this:
In testing a few weeks ago, I would sometimes see this 2nd style of URL even for woff2 files, and my suspicion is that less-frequently-accessed fonts return URLs in the 2nd form, so this user agent change isn't guaranteed to always fix the issue for all fonts. (Testing again today, I get woff files in the 1st format, so Google may have made a change on their end now) The assumption in the code that breaks with this 2nd URL format is here:
This will always return the string The real fix here could be as easy as changing the above line to something like: $filename = md5( $url ); in order to hash the URL uniquely and not worry about exactly what format it takes. |
Issue description:
I suspect that whatever mime type Kirki used to rely on to get woffs is no longer working. Fonts are loaded as octet-streams.
Version used:
5.0.0
Using
theme_mods
oroptions
?theme_mods
Code to reproduce the issue (config + field(s))
Load 'Inter' within a typography control, and look within web inspector (Network > Fonts) to see the file type of the font loaded.
I noticed something strange in web inspector this week:
Rather than woff files appearing, fonts from Kirki were rendered as octet-streams.
From researching this a bit more, if a font does not have a MIME type it takes a
Content-Type: binary/octet-stream
instead ofapplication/font-woff
.This is the code Kirki uses to retrieve Google fonts:
I tried a proof of concept, changing it to:
A key change is the user_agent.
$user_agent = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0';
Ensures we just get woff2 files (which do load correctly).
My guess is that seeing as woff2 support is basically assumed at this point, Google has stopped sending back .woff files when the older user agent is used - and instead you see this octet-stream version.
A major issue arises when trying to load the popular 'Inter' font within the typography control in Kirki. The octet-stream version of it doesn't render at all.
I'd really appreciate it if Themeum looked into this.
The text was updated successfully, but these errors were encountered: