Site logo

[Support request] Function mentioned in tutorial missing

Home Forums Support [Support request] Function mentioned in tutorial missing

Home Forums Support Function mentioned in tutorial missing

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2500684
    hoya

    I watched your video on adding local fonts. Firstly, the link on your documentation is no longer valid, although that page did give a redirect. However, that source is not showing the function that I need to copy in order to upload the font files to my media library. Can you paste the function here that I need to add to Code Snippets?

    #2500893
    Fernando
    Customer Support

    Hi Hoya,

    Are you referring to this?:

    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;
    } );

    If so, it can be found in this article: https://docs.generatepress.com/article/adding-local-fonts/#uploading-our-font

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.