Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #293669

    Hi guys,

    I read this: https://kriesi.at/support/topic/new-custom-font/ and try to do exactly the same but for this google font: https://www.google.com/fonts#QuickUsePlace:quickUse/Family:Yanone+Kaffeesatz , but.. it’s crashes my theme, I put it at the final of the functions.php

    add_filter( ‘avf_google_heading_font’, ‘avia_add_heading_font’);
    function avia_add_heading_font($fonts)
    {
    $fonts[‘Yanone Kaffeesatz’] = ‘Yanone Kaffeesatz:200,400,700′;
    return $fonts;
    }

    add_filter( ‘avf_google_content_font’, ‘avia_add_content_font’);
    function avia_add_content_font($fonts)
    {
    $fonts[‘Yanone Kaffeesatz’] = ‘Yanone Kaffeesatz:200,400,700′;
    return $fonts;
    }

    so, after it, i refresh my theme and appers it: Parse error: syntax error, unexpected T_STRING in /var/www/html/partyaholic.com.br/web/wp-content/themes/enfold/functions.php on line 488

    what i need to do to add this google font? pls, help me!

    ty

    #293736

    Hi arthurhpaulino!

    Thank you for using the theme.

    The code looks correct. Please edit functions.php, find this code on line 16:

    if(isset($avia_config['use_child_theme_functions_only'])) return;
    

    Below, add this code:

    add_filter( 'avf_google_heading_font',  'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Yanone Kaffeesatz'] = 'Yanone Kaffeesatz:400,700,300,200';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font',  'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    $fonts['Yanone Kaffeesatz'] = 'Yanone Kaffeesatz:400,700,300,200';
    return $fonts;
    }

    Best regards,
    Ismael

    #293772

    Hello,

    i edit the functions.php and the filter works. But the font is not displayed. I have added the google font “Shadows Into Light” in this way:

    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;
    }

    Do I have to do something in addition?

    Please help me!

    Best regards,
    Christian

    #293822

    I put this code below the line 16 and I’m still getting the same error “Parse error: syntax error, unexpected T_STRING in /var/www/html/partyaholic.com.br/web/wp-content/themes/enfold/functions.php on line 502”, this second code you pass to me works, but the error continues at the old one.. at the final of the functions.php

    And ty, this is amazing theme! :D

    #294163

    Can you help me Ismael? please, i need to finish this site..
    Ty

    #294176

    Hi!

    Thank you for the update.

    This works on my end. Did you add any more code other than google font filter? Please get a fresh copy of functions.php then replace the old one. Find the code on line 16 then add the google filter. Maybe, you accidentally edited the file.

    Best regards,
    Ismael

    #294177

    Hey!


    @designbar1
    : Please use this:

    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;
    }

    Cheers!
    Ismael

    #294221

    Hey Ismael,

    you are the best! Now it works. :-)
    Thank you very much.

    Christian

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