Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #464799

    Adding a new google font isn’t hard via that instruction:

    http://kriesi.at/documentation/enfold/register-additional-google-fonts-for-theme-options/

    but if i want to use the font only via quick css without setting up the font in enfold options dialog – there is no effect.
    it seems that the font is only activated if i use it in Enfold Options

    I managed it by giving at advanced Styling f.e. the h6 that new font
    Than in quick css i can use it globaly

    So is there a way to activate it without that makeshift?

    • This topic was modified 9 years, 5 months ago by Guenni007.
    #465290

    Hi Guenter!

    Are you trying to include the additional font via @font-face? if so it won’t work with Quick CSS as this rule needs to be placed at the very start of the stylesheet.

    Cheers!
    Josue

    #466350

    to use it with enfold i managed it this way (link above)

    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;
    }

    But the font is not active till any option in Enfold is defined by with this font.
    So i often give via advanced styling the h6 that font.

    After that i can use the font via quick css too – but without doing the h6 “trick” settings in quick css have no effect.

    #466352

    Hey!

    Yeah that’s expected because that method is meant to be used for Fonts that are going to be set in General Styling > Fonts or Advanced Styling, if that’s not your case you can use the @import method (on child style.css) or something like this in functions.php:

    add_action('wp_head', function() {
    ?>
    <link href='http://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css'>
    
    <?php
    });

    Cheers!
    Josue

    #466355

    so what would you use to activate the font?
    the link option could work ?

    is this the correct way:

    https://kriesi.at/support/topic/add-custom-font-which-arent-listed-as-official-google-fonts/#post-406903

    #466357

    Yeah both methods lead to the same result, once the call is made (either with @import or <script>) the font is “activated” and available to use.

    Regards,
    Josue

    #466529

    thanks Josue – can be closed now

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Activating an additional Google Font’ is closed to new replies.