• Resolved teabreakbakes

    (@teabreakbakes)


    Hi there,

    Google’s sitespeed index is still picking up the fonts that I added to the site as being render blocking, and they weren’t picked up by the plug-in. I tried adding the font family too but it didn’t work either. I’m using antic and shadows into light 2, what am I doing wrong?

    Thanks,
    Joe

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    Hi Joe,

    I browsed thru your page source and noticed that Antic isn’t loaded using WordPress’ stylesheet queueing system (wp_enqueue_style()) so that’s the reason why OMGF can’t find it.

    You’ll need OMGF Pro for that, which you can find here.

    I couldn’t find Shadows Into Light, could you share an example page of where that font is loaded?

    Thread Starter teabreakbakes

    (@teabreakbakes)

    Hi Daan,

    Thanks, both of them are in the same piece of code in the functions.php so what have I done wrong there that they aren’t loaded in that way to be picked up?
    Shadows into light 2 is all the headers.
    Sorry if this is rookie mistakes but I’ve just followed the instructions through Google fonts for adding them.

    Thanks,
    Joe

    Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    If you share the code you’ve used to add them, I can point out your mistakes 🙂

    Thread Starter teabreakbakes

    (@teabreakbakes)

    Thanks Daan, see below-

    add_action( 'storefront_header', 'jk_storefront_header_content', 40 );
    	function jk_storefront_header_content() { ?>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Antic&display=swap" rel="stylesheet">
    Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    Hi again,

    Try replacing the code you shared with the following:

    add_action('wp_enqueue_scripts', 'jk_storefront_header_content', 40);
    
    function jk_storefront_header_content()
    {
    	wp_enqueue_style('jk-google-fonts', 'https://fonts.googleapis.com/css2?family=Antic&display=swap');
    }

    That way OMGF should be able to detect it. Let me know how it goes!

    Btw. I’ve removed the preconnects, because you don’t need to connect to fonts.googleapis.com anymore. 🙂

    Edit: just noticed you’ve already added Shadows Into Light using OMGF Additional Fonts, why not use OMGF AF to add Antic as well? Then you can remove the above code altogether!

    Thread Starter teabreakbakes

    (@teabreakbakes)

    Hi Daan,

    Superb! I did try loading it as an additional font before but it didn’t work- I think I must’ve not cleared the cache though.

    Thank you!

    Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    Awesome! Thanks for getting back to me 🙂

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Fonts not picked up’ is closed to new replies.