I want to add the Google Font “Open Sans Light”
So I add this to functions.php:
add_filter( 'avf_google_heading_font', 'add_custom_open_sans');
add_filter( 'avf_google_content_font', 'add_custom_open_sans');
function add_custom_open_sans($fonts) {
$fonts['Open Sans Light'] = 'Open+Sans:300';
return $fonts;
}
an this to my css:
#top .entry-content-wrapper h1 {
text-transform: none;
font-weight:300 !important;
font-size:40px;
font-family:'Open Sans Light', sans-serif !important;
color:#58585a;
}
But the font didn’t show up. What’s wrong?
Hey mdorfi,
Please try this instead:
add_filter( 'avf_google_heading_font', 'avia_add_heading_font');
function avia_add_heading_font($fonts)
{
$fonts['Open Sans Light'] = 'Open Sans:300';
return $fonts;
}
If that doesn’t work then please post a link to the site in question and we’ll have a closer look.
Best regards,
Rikard
I got it to work. I forgot to add the following to header.php:
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300" rel="stylesheet">