Tagged: custom fonts, Fonts, function.php, google font
-
AuthorPosts
-
July 13, 2016 at 10:58 am #660262
Hi, i’ve added in my child functions.php this code:
add_filter( 'avf_google_heading_font', 'avia_add_heading_font'); function avia_add_heading_font($fonts) { $fonts['Open Sans'] = 'Open Sans:300,300italic,400,400italic,600,600italic,700,700italic,800,800italic&subset=latin,latin-ext'; $fonts['Lato'] = 'Lato:300,300italic,400,400italic,700,700italic,900,900italic&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:300,300italic,400,400italic,600,600italic,700,700italic,800,800italic&subset=latin,latin-ext'; $fonts['Lato'] = 'Lato:300,300italic,400,400italic,700,700italic,900,900italic&subset=latin,latin-ext'; return $fonts; }
But it doesn’t work (on machine without fonts installed): looking at code, i see this in head:
<!-- google webfont font replacement --> <link rel='stylesheet' id='avia-google-webfont' href='//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic,900,900italic&subset=latin,latin-ext%7COpen+Sans:300,300italic,400,400italic,600,600italic,700,700italic,800,800italic&subset=latin,latin-ext' type='text/css' media='all'/>
and
<link rel='stylesheet' id='open-sans-css' href='https://fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext&ver=4.5.3' type='text/css' media='all' />
Could it be encoding problem? if you click eg on the first link with pipe “%7C” it’s a 404…
Thanks
July 13, 2016 at 2:04 pm #660409Hi Nomesia!
Do you mind creating a temporary admin login and posting it here privately so we can look into it?
Regards,
YigitJuly 13, 2016 at 2:11 pm #660414Hi, private answer with it, thanks=)
July 14, 2016 at 1:27 pm #660830Hi,
Have you added the fonts elsewhere? When i comment it out in functions.php file of your child theme, i still can see them in source code
Best regards,
YigitJuly 14, 2016 at 2:19 pm #660857Hi,
no i’ve edited functions.php, style.css of child theme (font-family for some elements) and i’ve set them in “fonts” tab theme settings…
July 18, 2016 at 3:41 pm #662070Hi,
There might be some corrupted files, so please delete all theme files completely via FTP, before installing a fresh copy from your themeforest account. Here is a short tutorial on how to install the theme via FTP, in case you are not sure how that works:
Best regards,
AndyJuly 18, 2016 at 6:28 pm #662186No results:(
The problem is that selecting in font tabs Lato for heading and Open Sans for body, it generates a 404 for “http://fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic,900,900italic&subset=latin,latin-ext%7COpen+Sans:300,300italic,400,400italic,600,600italic,700,700italic,800,800italic&subset=latin,latin-ext”
i need all font weights, not only the google font theme ones…
July 18, 2016 at 9:39 pm #662274I’ve noticed this issue with the update recently myself… I tried to add this in the functions.php still nothing showing up. Last time I added a google font it worked fairly simple.
if ( !defined('ABSPATH') ){ die(); } add_filter( 'avf_google_heading_font', 'avia_add_heading_font'); function avia_add_heading_font($fonts) { $fonts['Carter One'] = 'Carter One'; return $fonts; } add_filter( 'avf_google_content_font', 'avia_add_content_font'); function avia_add_content_font($fonts) { $fonts['Carter One'] = 'Carter One'; return $fonts; }
July 19, 2016 at 1:31 pm #662461@Phil
Please open your own ticket about this, otherwise it gets too confusing in this thread.
@Nomesia
When using Google fonts you can only use the font weights which Google is providing.
Maybe this plugin is for you: https://de.wordpress.org/plugins/easy-google-fonts/Best regards,
AndyJanuary 12, 2017 at 9:11 pm #732839I’ve installed the Easy Google Fonts plugin but not all of the fonts are displaying in the font dropdown in the Enfold Theme.
January 13, 2017 at 7:43 am #733012 -
AuthorPosts
- You must be logged in to reply to this topic.