Tagged: google fonts
-
AuthorPosts
-
September 5, 2018 at 6:08 pm #1006238
Hi there,
I realize that this will affect page load, but we need to activate a third google font to the site. Currently I have the heading font set to Oswald and the body text set to Roboto. I need to add Droid Serif to this activated fonts list. I can’t seem to find the right code through other forum posts. Can you please advise?Thanks!
September 5, 2018 at 7:42 pm #1006285Hey kristenangel,
You can add the font to the function that you’re using already.
Can you show us the code you’re using?
Did you upload the Droid font already?
Best regards,
VictoriaSeptember 5, 2018 at 9:35 pm #1006350Droid Serif is already in the dropdown list of fonts available to the theme, so I shouldn’t need to upload a second version, correct?
Regardless, I have this in my functions file:
add_filter( 'avf_google_heading_font', 'avia_add_heading_font'); function avia_add_heading_font($fonts) { $fonts['Droid Serif'] = 'Droid Serif:400'; return $fonts; } add_filter( 'avf_google_content_font', 'avia_add_content_font'); function avia_add_content_font($fonts) { $fonts['Droid Serif'] = 'Droid Serif:400'; return $fonts; }And am using !important to the text css to try and override the theme choice fonts, but not having any luck.
Thanks~
-
This reply was modified 7 years, 2 months ago by
kristenangel.
September 6, 2018 at 5:18 am #1006440Hi,
You have to add the font manually. This article should help.
// https://www.wpbeginner.com/wp-themes/how-add-google-web-fonts-wordpress-themes/
function wpb_add_google_fonts() { wp_enqueue_style( 'wpb-google-fonts', 'http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,700,300', false ); } add_action( 'wp_enqueue_scripts', 'wpb_add_google_fonts' );Best regards,
IsmaelSeptember 6, 2018 at 4:14 pm #1006696Thank you Ismael, this worked.
September 6, 2018 at 4:47 pm #1006727Hi kristenangel,
Glad we could help :)
If you need further assistance please let us know.
Best regards,
Victoria -
This reply was modified 7 years, 2 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.
