Tagged: google fonts, h1 tags
-
AuthorPosts
-
July 21, 2015 at 5:28 am #476292
Hi–
I added and activated the WP Google Fonts plugin but cannot get H1 to display the McLaren font. I added the code below (found in forums) but it still won’t show. I’d like ALL THE H tags to be McLaren.
How do I override the template CSS?h1 { font-family: ‘McLaren’, sans-serif; }
Thanks for any help—
July 21, 2015 at 9:24 am #476353Hi Cybernun!
Our support for third party plugins is limited but you can get that font by altering the theme instead, add the following to your child themes functions.php:
add_filter( 'avf_google_heading_font', 'avia_add_heading_font'); function avia_add_heading_font($fonts) { $fonts['Source Sans Pro'] = 'Source Sans Pro:400,600,800'; return $fonts; } add_filter( 'avf_google_content_font', 'avia_add_content_font'); function avia_add_content_font($fonts) { $fonts['Source Sans Pro'] = 'Source Sans Pro:400,600,800'; return $fonts; }
You will have to replace the Source Sans Pro with the font you would like instead. After doing this it will be available in the menus in the backend.
Regards,
RikardJuly 26, 2015 at 9:20 pm #478790I CANNOT ACCESS MY SITE NOW. I PUT IN THE CODE YOU SENT REPLACED WITH McClaren font and got this as an error:
Parse error: syntax error, unexpected ‘function’ (T_FUNCTION) in /home/thenutro/public_html/nutsite/wp-content/themes/enfold/functions.php on line 151
HELP!
July 26, 2015 at 9:33 pm #478797I FTP’ed the original from the template and got it restored. Sure wish there was a simpler way of getting that Google font in there.
July 27, 2015 at 10:32 am #478989Hey!
Yes there is a simpler way, you can hire a freelancer. If you don’t want to do that, here is the code nicely laid out for you to copy/paste, I even tried it myself to make sure that is works:
add_filter( 'avf_google_heading_font', 'avia_add_heading_font'); function avia_add_heading_font($fonts) { $fonts['McLaren'] = 'McLaren'; return $fonts; } add_filter( 'avf_google_content_font', 'avia_add_content_font'); function avia_add_content_font($fonts) { $fonts['McLaren'] = 'McLaren'; return $fonts; }
Please add it to the bottom of your child themes function.php. Not using a child theme? Then please refer to this: http://kriesi.at/documentation/enfold/portfolio-item/create-a-child-theme/. If you don’t use a child theme you will have to make this change every time you update the theme.
Best regards,
Rikard -
AuthorPosts
- You must be logged in to reply to this topic.