Google fonts problem

I have a Google fonts issue with my Staging site. It is a child theme of Pro 3.0.4. The issue is that the google fonts are missing. When I did a comparison with our Live site, I noticed that the Staging site is missing the tag for the relevant fonts e.g:

<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:400,400i,700,700i|Merienda:700|Work+Sans:500&amp;subset=latin,latin-ext" type="text/css" media="all" data-x-google-fonts=""></link>

Our Live site (which is working fine) is an earlier version: a child theme of Pro 2.1.5

I’ve tried going into the Font Manager on our staging site and adding ‘Work Sans’ but it doesn’t seem to do anything (but looking at the Live site, it is not added to the Font Manager there anyway)

One thing I did which does fix the problem is by adding the above tag into the ‘Original Footer’ / Footer Content code snippet area. However this is not a good solution as it would be too difficult for other devs to find it.

Strangely I do see requests for some gstatic fonts in the Network inspector…but not for the Work Sans which is one that is missing. Seems that Lato is actually loading.

Can you please advise what might be wrong / and how to fix it.

Thank you

Update - after reading some of the other posts, I tried adding the tag as in import in the global CSS area…but that didn’t fix it.

Hello @SFI_AUS,

Thanks for writing in!

Please try out the solution shared in following thread and let us know the outcome:

In case problem is still there, kindly share login details in secure note for us to take a closer look.

Thanks.

Hi @Prasant, thanks. I managed to get it working by adding it to the functions.php. For anyone who’s interested:

<?php
function wpb_add_google_fonts() {
   wp_enqueue_style( 'wpb-google-fonts', 'https://fonts.googleapis.com/css?family=Lato:400,400i,700,700i|Work+Sans:500&display=swap', false );
   }
   
   add_action( 'wp_enqueue_scripts', 'wpb_add_google_fonts' );
?>  

happy for you to close the ticket.

Glad to hear! Feel free to open a new topic if you need anything else.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.