Site logo

Archived topic

Sorry, you are not allowed to upload this file type.

7 replies · Started by Hywel on October 31, 2022

Viewing posts 1–8 of 8

Hi, was following your guide to adding fonts locally and I keep getting this message...

“life-savers-v18-latin-regular.ttf” has failed to upload.
Sorry, you are not allowed to upload this file type.

Any advice?

Thanks

Hi, I used the snippet provided in that document but it still gives the error.

add_filter( 'upload_mimes', function( $mimes ) {
$mimes['woff'] = 'application/x-font-woff';
$mimes['woff2'] = 'application/x-font-woff2';
$mimes['ttf'] = 'application/x-font-ttf';
$mimes['svg'] = 'image/svg+xml';
$mimes['eot'] = 'application/vnd.ms-fontobject';

return $mimes;
} );

Anyway I uploaded this without the ttf line...

/* life-savers-regular - latin */
@font-face {
font-family: 'Life Savers';
font-style: normal;
font-weight: 400;
src: url('https://www.kohlipeisland.org/wp-content/uploads/2022/11/life-savers-v18-latin-regular.eot'); /* IE9 Compat Modes */
src: local(''),
url('https://www.kohlipeisland.org/wp-content/uploads/2022/11/life-savers-v18-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('https://www.kohlipeisland.org/wp-content/uploads/2022/11/life-savers-v18-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('https://www.kohlipeisland.org/wp-content/uploads/2022/11/life-savers-v18-latin-regular.woff') format('woff'), /* Modern Browsers */
url('https://www.kohlipeisland.org/wp-content/uploads/2022/11/life-savers-v18-latin-regular.svg#LifeSavers') format('svg'); /* Legacy iOS */
}

I can see the font under Typography Manager but when I select it it does nothing.

Hi,

To clarify, when you use Life Saver as a font in the Typography, it doesn’t work?

Yes that's correct.

Thanks

Thank you. The links in your @font-face rules seem to be incorrect. Can you go to Media > Library, and re-copy and paste the links of the fonts from there?

Hi,

I have redone the process and It's now working. Which is odd considering it didn't work the previous 4 times I tried! Thanks for your help anyway.

You're welcome Hywel! Glad it's working now!

This archived topic is closed to new replies.