Can't add custom fonts

I’ve uploaded the .woff font files into the Media Library, but when I go to add the custom fonts the media browser is blank.

Looking through some other threads, I’ve done the following to try to resolve the issue:

Added this code to functions.php:
add_filter(‘upload_mimes’, ‘add_custom_upload_mimes’);
function add_custom_upload_mimes($existing_mimes) {
$existing_mimes[‘otf’] = ‘application/x-font-otf’;
$existing_mimes[‘ttf’] = ‘application/x-font-ttf’;
$existing_mimes[‘eot’] = ‘application/vnd.ms-fontobject’;
$existing_mimes[‘woff’] = ‘font/woff’;
$existing_mimes[‘woff2’] = ‘font/woff2’;
return $existing_mimes;
}

I also tried adding the .woff files via the “Add From Server” plugin.

Thanks for your help.

Hi Jonathan,

Thank you for writing in, please check for a plugin conflict. This seems to happen with other code is hooking into upload_mimes. It works fine if you are just using Cornerstone/Pro. Please do testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

Let us know how it goes,
Cheers!

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