Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #534389

    Hi,

    I’m trying to add the following fonts:

    robotolight
    roboto_slabbold

    I 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?

    #534393

    Ok I fixed the error. But I really need to add these 2 fonts.

    robotolight
    roboto_slabbold

    #534438
    #534878

    Hi 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?

    #534963

    Hey!

    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,
    Elliott

    #535498

    Hi elliott,

    It’s just Roboto and light is the variation.

    And Robot Slab too.

    I’ll try that code and hopefully it works.

    #537100

    Hi,

    Did you have any luck with Yigits code? Please let us know if you should need any more help on the topic.

    Thanks,
    Rikard

    #539127

    Ok 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;
    }

    #539263

    Hey!

    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!
    Elliott

    #539439

    OK 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?

    #539725

    The 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?

    #540104

    Hi,

    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,
    Rikard

    #540987

    Hi Rikard,
    Login details below

    #541199

    Hey!

    We’ll need a link to your site as well.

    Regards,
    Elliott

    #541556

    Oh thats a rookie mistake I made lol

    #541938

    Hi!

    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.
    #543227

    Hi Elliott,

    Ive updated to administrator. Not added child theme yet though, I’ll do this tonight.

    #545071

    Hey!

    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

Viewing 18 posts - 1 through 18 (of 18 total)
  • You must be logged in to reply to this topic.