Custom Font Uploads Not Working

Hi,

As you can see on my site https://stefanguy.com I’ve successfully added custom fonts. I achieved this a few months ago with WOFF files with no problem; they work perfectly.

However. I’m trying to add one more font, again a WOFF file but no matter what I do I cannot upload it. I keep receiving this error message “Sorry, this file type is not permitted for security reasons.”

I’ve tested a multitude of font files (woff and woff2) including the ones that I successfully uploaded a few months ago and none upload. All receive this same message.

So it worked a few months ago and now it doesn’t.

I’ve tried this:


function my_mime_types($mime_types){
$mime_types[‘woff’] = ‘application/x-font-woff’;
return $mime_types;
}

add_filter(‘upload_mimes’, ‘my_mime_types’, 1, 1);


And this allows me to upload the file however the file type is listed as “application/x-font-woff” and not “font/woff” like the fonts I was able to successfully upload.

“application/x-font-woff” doesn’t seem to be recognised by the Font Manager only “font/woff”.

Any help would be much appreciated. I’m missing the Bold Font for my Body text and I desperately want to add it.

Thanks

You can close this.

I’ve managed to upload it after seeing this on your forum:

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.

Thanks

Hello @stefanguy,

We are just glad that you have figured it out a way to correct the said issue.
Thanks for letting us know!

Best Regards.

Is this an issue that will be addressed soon? Although I have been able to upload woff files to the media library, I have been unable to select them in the custom font manager, despite trying the different mime code snippets in functions.php.

Ok, after trying many different plugins for extending Wordpress filetypes, I found one that solves the issue. The plugin called “Disable Real MIME Check” made it so that when I upload WOFF files, they are not blocked by Wordpress and are categorized as font/woff instead of application/x-font-woff and now show up in the custom font manager in Pro/X.

3 Likes

Hi Joshua,

Thanks for sharing this plugin information. This is really useful for other users encountering the same issue.
If you need anything else we can help you with, don’t hesitate to open another thread.

Cheers.

Theme.co, since this appears to broken functionality in the theme, could we perhaps get an assurance that you’re not going to rely on us adding custom functions to bypass server-side MIME security or installing yet another plug-in, but are going to fix it?

1 Like

Hi Peter,

Rest assured that this already added to our issue tracker so the developers will be made aware of it.

You can check our changelog page when we release an update to see if a fix for this is included.

Thanks,

thanks peter

You are most welcome. :slight_smile:

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