Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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.php

    add_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,
    Robin

    #716485

    Hi robinmetral!

    Please refer to this post – http://kriesi.at/documentation/enfold/register-additional-google-fonts-for-theme-options/

    Cheers!
    Yigit

    #716541

    Hi 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
    Robin

    #716558

    Hi,

    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,
    Yigit

    #716771

    Thanks!

    #717613

    Hey!

    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!
    Ismael

    #717614

    Hey!

    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,
    Ismael

    #717819

    Works perfectly!
    Thanks :)

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Add Google fonts to header fonts list’ is closed to new replies.