Tagged: google fonts
Hi,
I’m new to WordPress themes, however I have read all sorts of posts on this forum about how to add Google Fonts, and I have tried everything, but I just can’t get the font Dosis to appear in the dropdown boxes in the Styling page.
I was able to get other Google Fonts, such as Roboto. But can’t get Dosis.
I have also installed the Google Fonts plugin, but that has not helped.
Dosis is a key element of our branding, and I need to make it work.
Can anyone help please?
Thanks.
Hey loyalzoo!
Please take a look at this topic: https://kriesi.at/support/topic/new-custom-font/
Cheers!
Josue
Hi Josue,
I had already tried what is suggested in that thread. In fact, adding Alef or Roboto works for me perfectly.
But adding Dosis doesn’t. If I do, the name ‘Dosis’ will appear in the drop down lists in Styling, in quotes, and if selected it will just revert to the default font.
Not sure why the suggested method works with Alef, Roboto and others, but it doesn’t work with Dosis, albeit being among Google’s fonts for quite a while.
Can you please help?
Thanks.
Hey!
Please add this on functions.php:
add_filter( 'avf_google_heading_font', 'avia_add_heading_font');
function avia_add_heading_font($fonts)
{
$fonts['Dosis'] = 'Dosis:400,500,600,700,800';
return $fonts;
}
add_filter( 'avf_google_content_font', 'avia_add_content_font');
function avia_add_content_font($fonts)
{
$fonts['Dosis'] = 'Dosis:400,500,600,700,800';
return $fonts;
}
What elements or text are you trying to change? You can manually apply the font to them if the above code itself doesn’t work.
h1, h2, h3, h4, h5, h6 {
font-family: 'Dosis', sans-serif;
font-weight: 500;
}
Cheers!
Ismael
h1, h2, h3, h4, h5, h6 {
font-family: ‘Dosis’, sans-serif;
font-weight: 500;
}
Wow! This really worked (in the Quick CSS)!
Many thanks!