-
AuthorPosts
-
November 24, 2016 at 4:34 pm #716484
Hello,
I’ve been wondering how to add new Google fonts to the header fonts list.
I’ve seen this advice on another thread: add the following code in functions.phpadd_filter( 'avf_google_heading_font', 'avia_add_heading_font'); function avia_add_heading_font($fonts) { $fonts['FONT NAME'] = 'FONT NAME'; return $fonts; }
However, the advice didn’t work in my case. Is there a specific way to write the name of the Google font I want to add? I was trying to replace “FONT NAME” by “Open Sans Light”, which didn’t change anything.
Furthermore, how come I can’t choose a “content” font such as Helvetica for my headers?
Thanks in advance for your support,
RobinNovember 24, 2016 at 4:35 pm #716485Hi robinmetral!
Please refer to this post – http://kriesi.at/documentation/enfold/register-additional-google-fonts-for-theme-options/
Cheers!
YigitNovember 24, 2016 at 6:30 pm #716541Hi Yigit,
Thanks for the answer!
I’d seen this, but it still doesn’t work :(Basically I want to use a lighter version of the Open Sans font that already features in Enfold for my headers.
Any clue on how I might do this?Cheers
RobinNovember 24, 2016 at 8:20 pm #716558Hi,
Please post us your login credentials (in the “private data” field), so we can take a look at your backend.
Login credentials include:
- The URL to the login screen.
- A valid username (with full administration capabilities).
- As well as a password for that username.
- permission to deactivate plugins if necessary.
Best regards,
YigitNovember 25, 2016 at 11:58 am #716771Thanks!
November 28, 2016 at 8:31 am #717613Hey!
Thank you for the info.
Please add this code in the child theme’s functions.php file.
add_filter( 'avf_google_content_font', 'avia_add_content_font'); function avia_add_content_font($fonts) { $fonts['Google fonts']['Roboto Light'] = 'Roboto Light:400,700'; $fonts['Google fonts']['Open Sans Light'] = 'Open+Sans:300i,400'; $fonts['Google fonts']['Source Sans Pro'] = 'Source+Sans+Pro'; return $fonts; }
Cheers!
IsmaelNovember 28, 2016 at 8:31 am #717614Hey!
UPDATE: Please use this code instead.
add_filter( 'avf_google_heading_font', 'avia_add_heading_font'); function avia_add_heading_font($fonts) { $fonts['Roboto Light'] = 'Roboto Light:400,700'; $fonts['Open Sans Light'] = 'Open+Sans:300i,400'; $fonts['Source Sans Pro'] = 'Source+Sans+Pro'; return $fonts; } add_filter( 'avf_google_content_font', 'avia_add_content_font'); function avia_add_content_font($fonts) { $fonts['Google fonts']['Roboto Light'] = 'Roboto Light:400,700'; $fonts['Google fonts']['Open Sans Light'] = 'Open+Sans:300i,400'; $fonts['Google fonts']['Source Sans Pro'] = 'Source+Sans+Pro'; return $fonts; }
Regards,
IsmaelNovember 28, 2016 at 3:41 pm #717819Works perfectly!
Thanks :) -
AuthorPosts
- The topic ‘Add Google fonts to header fonts list’ is closed to new replies.