-
AuthorPosts
-
May 15, 2017 at 9:27 pm #793519
I’ve reviewed several previous posts about how to add Google Fonts and they are all lacking a major step. The example that referred to has fonts and css already entered. Where do I find this information to replace within google fonts? The documentation does not explain this.
$fonts['PT Sans Narrow'] = 'PT Sans Narrow:400,700'; $fonts['PT Sans'] = 'PT Sans:400,700,400italic,700italic';The only information I can find for the Google font is:
<link href="https://fonts.googleapis.com/css?family=Metal+Mania" rel="stylesheet">
font-family: 'Metal Mania', cursive;So I would expect my code to look like:
add_filter( 'avf_google_heading_font', 'avia_add_heading_font'); function avia_add_heading_font($fonts) { $fonts['Metal Mania'] = 'Metal Mania:400'; return $fonts; } add_filter( 'avf_google_content_font', 'avia_add_content_font'); function avia_add_content_font($fonts) { $fonts['Metal Mania'] = 'Metal Mania:400'; return $fonts; }This didn’t work so I’ve tried all of the different permutations of 400 and cursive like:
$fonts['Metal Mania'] = 'Metal Mania:400';
$fonts['Metal Mania'] = 'Metal Mania:400cursive';
$fonts['Metal Mania'] = 'Metal Mania:cursive';So what exactly needs to be replaced and are any other steps involved? We I need to upload the font to the server? Does anything else need to happen in order to change a font?
May 15, 2017 at 9:32 pm #793523Hey MarsNJ,
I am not sure of the previous posts you are referring to, however the following article shows 3 incredibly simple ways to import Google Fonts into your WordPress installation:
http://www.wpbeginner.com/wp-themes/how-add-google-web-fonts-wordpress-themes/
Best regards,
Jordan ShannonMay 15, 2017 at 9:33 pm #793524Hey MarsNJ!
If you are not using a child theme, please find following line near top in Appearance > Editor > Functions.php file
if(isset($avia_config['use_child_theme_functions_only'])) return;and then add your code right below that line
Regards,
YigitMay 16, 2017 at 2:47 am #793655There are many previous posts on the topic, too many to list. Regardless I’d rather not just install another plugin if there’s already a code snippet for this. It doesn’t seem to work though. I am using a child theme as suggested in previous posts.
The code snippet from kriesi is as follows:
$fonts['PT Sans'] = 'PT Sans:400,700,400italic,700italic';I’m trying to add Metal Mania which has just one weight of 400. So what is wrong with the following:
$fonts['Metal Mania'] = 'Metal Mania:400';May 16, 2017 at 2:35 pm #793947Hi,
Please post us your login credentials (in the “private data” field), so we can take a look at your backend.Login credentials include:
- The URL to the login screen.
- A valid username (with full administration capabilities).
- As well as a password for that username.
- permission to deactivate plugins if necessary.
Best regards,
Yigit -
AuthorPosts
- You must be logged in to reply to this topic.
