Tagged: 

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #244427

    Hi,

    I’ve added the following in the function.php (not function-enfold.php):

    add_filter( ‘avf_google_heading_font’, ‘avia_add_heading_font’);
    function avia_add_heading_font($fonts)
    {
    $fonts[‘Bree Serif’] = ‘Bree Serif:400’;
    return $fonts;
    }

    add_filter( ‘avf_google_content_font’, ‘avia_add_content_font’);
    function avia_add_content_font($fonts)
    {
    $fonts[‘Bree Serif’] = ‘Bree Serif:400’;
    return $fonts;
    }

    However, the font doesn’t appear in the font selector in the theme options. Any idea?

    Thanks,

    Gabe

    #244729

    Hey chiummog!

    Please add this code below line 3 on functions.php:

    add_filter( 'avf_google_heading_font', 'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Bree Serif'] = 'Bree Serif';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font', 'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    $fonts['Bree Serif'] = 'Bree Serif';
    return $fonts;
    }

    The new font Bree Serif should be visible below all the fonts on the selection.

    Cheers!
    Ismael

    #244922

    Hi Ismael,

    I add the above code right after line 3 directly under:
    global $avia_config;

    This breaks the entire site, I cannot access backend, fronted, nothing!

    So what am I doing wrong?

    Regards,

    Gabriel

    #245228

    Hi Gabriel,

    Please revert the changes, can you create an administrator account and post it here as a private reply?

    Regards,
    Josue

    #245230
    This reply has been marked as private.
    #245248

    Hey Gabriel!

    The page went blank again, it appears to be a server issue because i tried the exact same code on my local install an the font was added, i think the answer is in the php error log, do you have access to it?

    Cheers!
    Josue

    #245331
    This reply has been marked as private.
    #245332
    This reply has been marked as private.
    #245499

    Hey!

    Thank you for posting the information.

    Please delete the code that you added first below functions.php. There is duplicate call for the avia_add_heading_font() function which breaks the theme. That should fix the issue and the Bree Serif font should be available on the heading font selection.

    Regards,
    Ismael

    #245585

    I would have reverted the changes if if could, but the page went blank, so the only way to do it was via FTP which i didn’t have access, sorry for the inconveniences.

    Cheers!
    Josue

    #245643

    Hi,

    thanks, no worries. Works now
    How do I add additional Google fonts? add the same code again or do I have to add the fontname to this code?

    Thanks,

    Gabriel

    #245676

    Hi Gabriel!

    No, you can include those in the same code:

    add_filter( 'avf_google_heading_font', 'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Bree Serif'] = 'Bree Serif';
    $fonts['Another font'] = 'Another font';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font', 'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    $fonts['Bree Serif'] = 'Bree Serif';
    $fonts['Another font'] = 'Another font';
    return $fonts;
    }
    

    Best regards,
    Josue

    #245712

    Perfect, thanks for your help! Please close post!

    Regards,

    Gabriel

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Google Font’ is closed to new replies.