Hi there,
I’m building a site to which I would like to add a custom font:
Here’s what I’m doing, and the font just disappears. Am I doing something wrong or using the wrong file?
Initially, WP does not accept woff, woff2 uploads, so here’s what I added to cross that bridge:
add_filter('upload_mimes', 'add_custom_upload_mimes');
function add_custom_upload_mimes($existing_mimes) {
$existing_mimes['otf'] = 'application/x-font-otf';
$existing_mimes['woff'] = 'application/x-font-woff';
$existing_mimes['woff2'] = 'application/x-font-woff2';
$existing_mimes['ttf'] = 'application/x-font-ttf';
$existing_mimes['svg'] = 'image/svg+xml';
$existing_mimes['eot'] = 'application/vnd.ms-fontobject';
return $existing_mimes;
}