Home > OS >  Google font not loading in wordpress theme [duplicate]
Google font not loading in wordpress theme [duplicate]

Time:10-08

I'm kinda new to WordPress custom theme building and I have a problem.

I have a google font Poppins and I have put the code in head.php:

<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=Poppins:wght@400;500;700&display=swap" rel="preload stylesheet" as="style">

when I open the network tab I see that they have indeed loaded:

see network tab here

I see the font being loaded on my computer but when I open it on some other device the font is not loaded. Some help will be much appreciated.

CodePudding user response:

Try

<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&display=swap" media="screen">

Also, if you have loaded the site/page previously on the other devices, make sure you clear cache.

  • Related