Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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!?

    #343245

    Hi 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,
    Arvish

    #343325

    Now it’s working! Thanks! But I also wonder if it’s possible to change the font weight to normal? It looks very bold now.

    #343697

    Hi!

    Can you post the link to your website please? On which element are you using this font family?

    Regards,
    Yigit

    #343916
    This reply has been marked as private.
    #345066

    Hey!

    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

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Adding new Google Font don't work!’ is closed to new replies.