[Support request] Not a issue about google fonts

Home Forums Support [Support request] Not a issue about google fonts

Home Forums Support Not a issue about google fonts

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #939991
    Longinos

    Hi Tom and team
    I’m going to post this just to warn. if you did not know, a new functionality of google fonts: You can indicate the font-display attribute in the url. For example:
    https://fonts.googleapis.com/css?family=Open+Sans&display=swap
    This generates the css w/ font-display:swap

    Cheers

    #940012
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You can implement this in GP using this filter:

    add_filter( 'generate_google_font_display', function() {
        return 'swap';
    } );

    Let me know if you have any other questions 🙂

    #1401528
    Howard

    Hi Tom:
    WHERE do you PUT this filter??? In the Website
    Thanks
    Howard

    #1401667
    Tom
    Lead Developer
    Lead Developer

    You should use one of these methods: https://docs.generatepress.com/article/adding-php/

    #1402619
    Howard

    Hi Tom:
    Added the above code to snippets succesfully. However, still get that notice from page speed insights:

    Leverage the font-display CSS feature to ensure text is user-visible while webfonts are loading. Learn more.
    ????
    Howard

    #1402808
    Howard

    However—- (???) I just did a MOBILE page speed insights test:
    100 💯 mobile
    💯 desktop

    How do you figure it??
    Howard

    #1402820
    David
    Staff
    Customer Support

    Hi there,

    maybe the site was cached on your server ? And it took a while to clear.

    #1402830
    Howard

    Thanks- great support and best WP theme!!

    #1403007
    David
    Staff
    Customer Support

    Glad to be of help !

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