Tagged: google fonts
-
AuthorPosts
-
October 14, 2013 at 10:06 pm #175278
Hi,
I read two threads on the forum (Adding Google Fonts (plural)&Google fotns with Extended Latin subset) and added code to functions.php (:add_filter( 'avf_google_heading_font', 'avia_add_heading_font'); function avia_add_heading_font($fonts) { $fonts['Open Sans'] = 'Open+Sans&subset=latin,latin-ext'; $fonts['Ubuntu Condensed'] = 'Ubuntu+Condensed&subset=latin,latin-ext'; return $fonts; } add_filter( 'avf_google_content_font', 'avia_add_content_font'); function avia_add_content_font($fonts) { $fonts['Open Sans'] = 'Open+Sans&subset=latin,latin-ext'; $fonts['Ubuntu Condensed'] = 'Ubuntu+Condensed&subset=latin,latin-ext'; return $fonts; }
but it did not result any change. I checked on inspect and found that in enfold.css:1 that creates a line:
font-family: 'Ubuntu+Condensed&subset=latin,latin-ext', 'HelveticaNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif;
instead
font-family: 'Ubuntu Condensed', 'HelveticaNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif;
In
head
section Google Font link is correct `<!– google webfont font replacement –>
<link id=”google_webfont_1″ rel=”stylesheet” type=”text/css” href=”http://fonts.googleapis.com/css?family=Ubuntu+Condensed&subset=latin,latin-ext” /><style type=’text/css’>`How can I fix it?
Regards
MarekOctober 14, 2013 at 10:49 pm #175313Hi mad2k!
Do you mind creating a temporary admin login and post it here privately?
Best regards,
YigitOctober 14, 2013 at 11:01 pm #175323This reply has been marked as private.October 14, 2013 at 11:09 pm #175326This reply has been marked as private.October 15, 2013 at 1:58 pm #175612Hi!
Please use following code – it should work
add_filter( 'avf_google_heading_font', 'avia_add_heading_font'); function avia_add_heading_font($fonts) { $fonts['Open Sans'] = 'Open Sans:400&subset=latin,latin-ext'; $fonts['Ubuntu Condensed'] = 'Ubuntu Condensed:400&subset=latin,latin-ext'; return $fonts; } add_filter( 'avf_google_content_font', 'avia_add_content_font'); function avia_add_content_font($fonts) { $fonts['Open Sans'] = 'Open Sans:400&subset=latin,latin-ext'; $fonts['Ubuntu Condensed'] = 'Ubuntu Condensed:400&subset=latin,latin-ext'; return $fonts; }
You can also load a different font weight – just replace 400 with another value. You can also load several weights (separate them with a comma like 400,700)
Regards,
PeterOctober 15, 2013 at 2:06 pm #175618Hi Peter,
Thank you, so it is about HTML ASCII Characters conversion… will try today.Regards,
MarekOctober 15, 2013 at 2:18 pm #175624This reply has been marked as private.October 15, 2013 at 2:19 pm #175626Hello!
I corrected the code. It should work now. A ‘ sign was missing.
Regards,
PeterOctober 15, 2013 at 2:29 pm #175632Will try :-)
Funny thing is that when I changed in register-admin-options.php line (291)
$avia_elements[] = array( "name" => "Heading Font",
and add line:
‘Ubuntu Condensed’=>’Ubuntu Condensed’,
it works. I have no idea how? Magic? … but it is your answer :-)
MarekOctober 15, 2013 at 2:48 pm #175643Hello Peter,
I think I found a solution. I added your code in functions.php and additionaly add to
Funny thing is that when I changed in register-admin-options.php line
'Ubuntu Condensed'=>'Ubuntu Condensed&subset=latin,latin-ext',
in$avia_elements[] = array( "name" => "Heading Font", and add line:
section.Will test it later for more fonts and let you know.
Regards,
Marek -
AuthorPosts
- The topic ‘Adding Google Fonts’ is closed to new replies.