Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #502198

    Looking for a bit of help with adding a Google font …

    I have been trying to add in a Google font as per the example at
    http://kriesi.at/documentation/enfold/register-additional-google-fonts-for-theme-options/

    The example works fine but my attempt gives a white screen

    Below is the code I put together for using ‘Open Sans Condensed’

    add_filter( 'avf_google_heading_font', 'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Open Sans Condensed'] = 'Open Sans Condensed:300,700';
    $fonts['Open Sans'] = 'Open Sans:400,700';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font', 'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    
    $fonts['Open Sans'] = 'Open Sans:400,700';
    $fonts['Open Sans Condensed'] = 'Open Sans Condensed:300,700';
    return $fonts;
    }
    #502224

    Hi Frank!

    Can you please provide us with backend access, so we can give it a look?

    Thanks a lot for your time and patience

    Cheers!
    Basilis

    #502239

    HI Basilis
    I have it working, I did the following

    before I had both the example and the font I wanted (see below), I removed the example and it works fine
    I would like to know why it did not work with the 2 fonts added

    add_filter( 'avf_google_heading_font', 'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['PT Sans Narrow'] = 'PT Sans Narrow:400,700';
    $fonts['PT Sans'] = 'PT Sans:400,700,400italic,700italic';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font', 'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    
    $fonts['PT Sans'] = 'PT Sans:400,700,400italic,700italic';
    $fonts['PT Sans Narrow'] = 'PT Sans Narrow:400,700';
    return $fonts;
    }
    
    add_filter( 'avf_google_heading_font', 'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Open Sans Condensed'] = 'Open Sans Condensed:300,700';
    $fonts['Open Sans'] = 'Open Sans:400,700';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font', 'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    
    $fonts['Open Sans'] = 'Open Sans:400,700';
    $fonts['Open Sans Condensed'] = 'Open Sans Condensed:300,700';
    return $fonts;
    }
    #502514

    Hi,

    Most likely because you used the same function name for both functions avia_add_heading_font

    Best regards,
    Rikard

    #502782

    Thanks Rikard,
    I got it …doo ….
    It would be great if you can add this information to the code snippet instructions .. as well as an example. It would help other in the future and cut down on support time concerning this.

    thanks again for a great theme and supper support

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Adding a Google font’ is closed to new replies.