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.