Tagged: google font
-
AuthorPosts
-
March 28, 2014 at 3:58 pm #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
March 29, 2014 at 9:21 am #244729Hey 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!
IsmaelMarch 30, 2014 at 12:19 am #244922Hi 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
March 30, 2014 at 11:44 pm #245228Hi Gabriel,
Please revert the changes, can you create an administrator account and post it here as a private reply?
Regards,
JosueMarch 30, 2014 at 11:53 pm #245230This reply has been marked as private.March 31, 2014 at 12:58 am #245248Hey 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!
JosueMarch 31, 2014 at 9:46 am #245331This reply has been marked as private.March 31, 2014 at 9:48 am #245332This reply has been marked as private.March 31, 2014 at 4:15 pm #245499Hey!
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,
IsmaelMarch 31, 2014 at 6:09 pm #245585I 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!
JosueMarch 31, 2014 at 7:04 pm #245643Hi,
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
March 31, 2014 at 7:53 pm #245676Hi 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,
JosueMarch 31, 2014 at 8:39 pm #245712Perfect, thanks for your help! Please close post!
Regards,
Gabriel
-
AuthorPosts
- The topic ‘Google Font’ is closed to new replies.