Adding Custom Font Issues

Hi X Team.

I’m having issues with adding a custom font to X. I’ve tried form settings and I’m getting a http error - or it is telling me that type of file is not allowed when I try to add it from the media section.

From my reading I’m aware this has happened. The site is hosted with site ground and every thing is up to date. If I have to get site ground to allow it do you have specific instructions as to what to request of them?

Hi There @mhkatz

Thanks for writing in! Please setup a child theme first and activate it by following our guide here (https://theme.co/apex/forum/t/setup-how-to-setup-child-themes/57).

Then, try adding the following code into your child theme’s functions.php file.

  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['ttf'] = 'application/x-font-ttf';
  	$existing_mimes['svg'] = 'image/svg+xml';
  	$existing_mimes['eot'] = 'application/vnd.ms-fontobject';
  	return $existing_mimes;
  }

Hope that helps.

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