Hosting Google Fonts locally

  • Posted in : Read WP
  • Tom
    Participant

    Hi there

    Thank you for creating this theme. I’m setting up my first blog and this theme is exactly what I was looking for!

    Now I’m trying to host Google Fonts locally. I have no experience doing that, so I tried to use the OMGF plugin. Unfortunately, it only recognizes fonts partially.

    It detects UnifrakturMaguntia, Coustard and Lora. The thing is: I use Lora, Playfair SC, Headland One and Bree Serif. I don’t use UnifrakturMaguntia, Coustard.

    Now I’m gonna try to do this manually using a guide like this: https://kinsta.com/blog/local-fonts/.

    Is there anything special I need to be aware of in regards to this theme?

    Thank you,

    Tom

    Tom
    Participant

    I think what I basically need is sample code to

    A) prevent the theme to request call to Google (I want to do that due to GDPR). I found this code in the functions.php that might be relevant:

    // Enqueue style
    wp_enqueue_style( ‘unifrakturmaguntia’, ‘//fonts.googleapis.com/css?family=UnifrakturMaguntia’ . $subset, null, null );
    wp_enqueue_style( ‘coustard’, ‘//fonts.googleapis.com/css?family=Coustard’ . $subset, null, null );
    wp_enqueue_style( ‘lora’, ‘//fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic’ . $subset, null, null );

    So I’d need to disable this somehow, but don’t know how.

    B) to redirect the calls to the fonts on my own server (I created that folder and copied the necessary fonts into it). The URL would be:

    https://mywebsite.com/wp-content/uploads/fonts/fontxyz.woff and
    https://mywebsite.com/wp-content/uploads/fonts/fontxyz.woff2

    Again, I don’t know where to add which code to make that work. Maybe you can help?

    Tom
    Participant

    I found someone to help me with this. It’s solved.

    serkan
    Moderator

    Hi,
    Thanks for the feedback.
    Have a nice weekend.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register