-
AuthorPosts
-
September 13, 2015 at 6:20 am #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; }
September 13, 2015 at 8:38 am #502224Hi 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!
BasilisSeptember 13, 2015 at 9:51 am #502239HI Basilis
I have it working, I did the followingbefore 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 addedadd_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; }
September 14, 2015 at 8:10 am #502514Hi,
Most likely because you used the same function name for both functions
avia_add_heading_font
Best regards,
RikardSeptember 14, 2015 at 2:59 pm #502782Thanks 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
-
AuthorPosts
- The topic ‘Adding a Google font’ is closed to new replies.