Google font manager not loading woff files

Hi guys,
i formerly added a costum font via google font manager without problems. I migrated my website and wanted to do the same, but the font manger won´t load any woff or woff2 files, only ttf who aren´t recommended as far as I know.
I added mime configuration to functions.php, which allows it, to upload those files into the library

function my_mime_types($mime_types){
    $mime_types['zip'] = 'application/zip';
    $mime_types['tiff'] = 'image/tiff';
    $mime_types['bmp'] = 'image/bmp';
	 $mime_types['woff'] = 'application/x-font-woff';
	$mime_types['woff2'] = 'application/x-font-woff2';
	$mime_types['svg'] = 'image/svg+xml';
return $mime_types;
}
add_filter('upload_mimes', 'my_mime_types', 1, 1);

but still google font manager doesnt show or load those files. Then i tried changing my wp-config.php with

define('ALLOW_UNFILTERED_UPLOADS', true);

But still no effect. So I´m a bit stuck here and can´t understand, where the problem could be.
Thanks in advance!

Hi Gehess,

Thank you for writing in regarding that issue, I’ve submitted this to our issue tracker so the developers will be made aware of it. But this issue is more on WordPress than on the Theme.

Actually with your custom function above, it is still work its just not showing a thumbnail/preview on the Media Library. Here’s a workaround, after you uploaded the font (woff or woff2, assuming there is no error encountered) act as if the font is there in library and its selected, click the Select Font File(s) button. Add a title to your custom font so we can easily identify it later.



Then add that font to the list of font that you’re using.



Font Manager

Cheers!

1 Like

Nice and simple! Thanks for the helpful advice! Worked just as you described!
Cheers!

Glad we were able to help :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.