Take your website
To the next level
Discover our newly launched customization services and elevate your web projects to new heights.
Delegate tasks, save time, and unlock the power of professional WordPress outsourcing.

Okay
  Public Ticket #2562021
GOOGLE FONT
Closed

Comments

  • Jhun Lorenz Asna started the conversation

    Hi!

    How to modify the theme files to add &display=swap for the google font css url? To fix this Ensure text remains visible during webfont load. I'm using Source Sans Pro. It seems like it's hard to concat this parameter string &display=swap to the variable $fonts_url

  • Jhun Lorenz Asna replied

    Hi! 

    I already solve but can you recommend something if it is the right way to add it. Thank you 

  •  7,242
    Oliver replied

    Hi,

    yes, in my mind the simplest solution use filter. 

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  • Jhun Lorenz Asna replied

    Hi, how to do that in your theme functions.php do you have example for the code?

  •  7,242
    Oliver replied

    Hi,

    Try to deregister:

    if($fonts_url = thegem_google_fonts_url()) {
            wp_enqueue_style( 'thegem-google-fonts', $fonts_url);
     }
    

    and add new one with your function

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver