-
AuthorPosts
-
October 28, 2014 at 11:12 am #342134
Hi!
I want to use a Google Font, called Shadows Into Light, and since it’s not in the list of fonts in the theme, I tested to use this code:add_filter( ‘avf_google_heading_font’, ‘avia_add_heading_font’);
function avia_add_heading_font($fonts)
{
$fonts[‘Shadows Into Light’] = ‘Shadows Into Light’;
return $fonts;
}add_filter( ‘avf_google_content_font’, ‘avia_add_content_font’);
function avia_add_content_font($fonts)
{
$fonts[‘Shadows Into Light’] = ‘Shadows Into Light’;
return $fonts;
}I found the code here: https://kriesi.at/support/topic/adding-a-google-font/
I added the code in the beginning of the functions.php, but it’s not working! I also edit the H1 in the advanced styling and can select the new font, but nothing happens!?October 30, 2014 at 5:41 am #343245Hi Effektid!
You maybe need to add the code at the very top of functions.php. Replace
<?php global $avia_config;
with
<?php global $avia_config; add_filter( 'avf_google_heading_font', 'avia_add_heading_font'); function avia_add_heading_font($fonts) { $fonts['Shadows Into Light'] = 'Shadows Into Light'; return $fonts; } add_filter( 'avf_google_content_font', 'avia_add_content_font'); function avia_add_content_font($fonts) { $fonts['Shadows Into Light'] = 'Shadows Into Light'; return $fonts; }
and it should work. Please don’t forget to save the theme options again.
Best regards,
ArvishOctober 30, 2014 at 11:08 am #343325Now it’s working! Thanks! But I also wonder if it’s possible to change the font weight to normal? It looks very bold now.
October 30, 2014 at 9:16 pm #343697Hi!
Can you post the link to your website please? On which element are you using this font family?
Regards,
YigitOctober 31, 2014 at 9:52 am #343916This reply has been marked as private.November 3, 2014 at 5:15 am #345066Hey!
If you have any additional questions at this time we kindly ask that you open them up in a separate thread. The longer threads get in the forum, they become more difficult to support as they tend to drift off topic and they also make it troublesome for users trying to search for solutions. Keeping threads relevant to their original inquiry ensures that we can keep better track of what has been resolved and that users can more effectively find answers to similar issues they might be experiencing.
Thanks!
Regards,
Ismael -
AuthorPosts
- The topic ‘Adding new Google Font don't work!’ is closed to new replies.