-
AuthorPosts
-
November 11, 2015 at 9:39 pm #534389
Hi,
I’m trying to add the following fonts:
robotolight
roboto_slabboldI added the code provided by yigit but now I get a 500 server error.
Surely there must be an easy way to add new google fonts without having to hack the theme files?
November 11, 2015 at 9:56 pm #534393Ok I fixed the error. But I really need to add these 2 fonts.
robotolight
roboto_slabboldNovember 11, 2015 at 11:36 pm #534438Hey!
Please refer to this post – http://kriesi.at/documentation/enfold/register-additional-google-fonts-for-theme-options/
Regards,
YigitNovember 12, 2015 at 4:41 pm #534878Hi Yigit,
I tried that already but the code isn’t easy to edit.
The font I want has lots of variations:
roboto slab bold 700, normal 400 etc
Do I need to copy the code for all variations?
November 12, 2015 at 6:21 pm #534963Hey!
It would look like this.
$fonts['Roboto Slab'] = 'Roboto Slab:100,300,400,700';
I don’t see any Roboto Light on the Google Fonts API. Do you mean Roboto Condensed? https://www.google.com/fonts#QuickUsePlace:quickUse/Family:Roboto+Slab:400,300,100,700%7CRoboto+Condensed
Best regards,
ElliottNovember 13, 2015 at 4:30 pm #535498Hi elliott,
It’s just Roboto and light is the variation.
And Robot Slab too.
I’ll try that code and hopefully it works.
November 17, 2015 at 5:53 am #537100Hi,
Did you have any luck with Yigits code? Please let us know if you should need any more help on the topic.
Thanks,
RikardNovember 19, 2015 at 5:59 pm #539127Ok so i have the follwing added to the end of my functions.php file: Anything else I need to do? How do I use the fints for headers, body text etc?
add_filter( ‘avf_google_heading_font’, ‘avia_add_heading_font’);
function avia_add_heading_font($fonts)
{
$fonts[‘Roboto’] = ‘Roboto:100,300,400,500,700,900’;
$fonts[‘Roboto Slab’] = ‘Roboto Slab:100,300,400,700’;
$fonts[‘Roboto Slab’] = ‘Roboto Condensed:300,400,700’;
$fonts[‘Roboto Slab’] = ‘Roboto Mono:100,300,400,500,700’;
return $fonts;
}add_filter( ‘avf_google_content_font’, ‘avia_add_content_font’);
function avia_add_content_font($fonts)
{$fonts[‘Roboto’] = ‘Roboto:100,300,400,500,700,900’;
$fonts[‘Roboto Slab’] = ‘Roboto Slab:100,300,400,700’;
$fonts[‘Roboto Slab’] = ‘Roboto Condensed:300,400,700’;
$fonts[‘Roboto Slab’] = ‘Roboto Mono:100,300,400,500,700’;
return $fonts;
}November 19, 2015 at 11:17 pm #539263Hey!
It should look like this.
$fonts[‘Roboto’] = ‘Roboto:100,300,400,500,700,900′; $fonts[‘Roboto Slab’] = ‘Roboto Slab:100,300,400,700′; $fonts[‘Roboto Condensed’] = ‘Roboto Condensed:300,400,700′; $fonts[‘Roboto Mono’] = ‘Roboto Mono:100,300,400,500,700′;
Otherwise Roboto Slab would = Roboto Mono only.
Cheers!
ElliottNovember 20, 2015 at 11:48 am #539439OK I’ve done that now but how do I actually use these fonts? They don’t show up in the enfold font options and they don’t appear in the page editor either?
November 20, 2015 at 4:06 pm #539725The only one showing up is Roboto in the header font options but not under the main body font options? would it work if I hand code the font into the content?
November 21, 2015 at 7:43 am #540104Hi,
Could you please provide us with a temporary admin login so that we can take a closer look? You can post the details in the Private Content section of your reply.
Regards,
RikardNovember 23, 2015 at 4:16 pm #540987Hi Rikard,
Login details belowNovember 23, 2015 at 10:16 pm #541199Hey!
We’ll need a link to your site as well.
Regards,
ElliottNovember 24, 2015 at 1:14 pm #541556Oh thats a rookie mistake I made lol
November 24, 2015 at 9:44 pm #541938Hi!
Can you please upgrade the login to administrator so we can check the code?
Also, it would be best to do the customization inside a child theme, http://kriesi.at/documentation/enfold/downloads/, so it is saved between updates.
Best regards,
Elliott- This reply was modified 9 years, 1 month ago by Elliott.
November 26, 2015 at 4:05 pm #543227Hi Elliott,
Ive updated to administrator. Not added child theme yet though, I’ll do this tonight.
December 1, 2015 at 12:05 pm #545071Hey!
I can see that you did not implement a child theme yet. However, try to add a “+” into your font code:
$fonts[‘Roboto+Slab’] = ‘Roboto+Slab:100,300,400,700′;
Cheers!
Andy -
AuthorPosts
- You must be logged in to reply to this topic.