
-
AuthorPosts
-
July 21, 2014 at 1:16 am #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
-
This topic was modified 10 years, 11 months ago by
arthurhpaulino.
July 21, 2014 at 8:44 am #293736Hi 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,
IsmaelJuly 21, 2014 at 10:41 am #293772Hello,
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,
ChristianJuly 21, 2014 at 1:06 pm #293822I 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
-
This reply was modified 10 years, 11 months ago by
arthurhpaulino.
July 22, 2014 at 5:00 am #294163Can you help me Ismael? please, i need to finish this site..
TyJuly 22, 2014 at 6:00 am #294176Hi!
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,
IsmaelJuly 22, 2014 at 6:01 am #294177Hey!
@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!
IsmaelJuly 22, 2014 at 8:27 am #294221Hey Ismael,
you are the best! Now it works. :-)
Thank you very much.Christian
-
This topic was modified 10 years, 11 months ago by
-
AuthorPosts
- The topic ‘Google Fonts Problem’ is closed to new replies.