-
AuthorPosts
-
June 26, 2015 at 9:09 am #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 OptionsI managed it by giving at advanced Styling f.e. the h6 that new font
Than in quick css i can use it globalySo is there a way to activate it without that makeshift?
- This topic was modified 9 years, 5 months ago by Guenni007.
June 27, 2015 at 2:26 pm #465290Hi 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!
JosueJune 30, 2015 at 12:49 pm #466350to 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.
June 30, 2015 at 12:52 pm #466352Hey!
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!
JosueJune 30, 2015 at 12:54 pm #466355so what would you use to activate the font?
the link option could work ?is this the correct way:
June 30, 2015 at 12:56 pm #466357Yeah 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,
JosueJune 30, 2015 at 3:41 pm #466529thanks Josue – can be closed now
-
AuthorPosts
- The topic ‘Activating an additional Google Font’ is closed to new replies.