Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #667672

    Hi! I’m trynig to apply slight changes to a website I didn’t make from scratch (let me point out that I have some skills but I’m not a genius).

    Here’s my problem. The font used in the webiste is Ubuntu (which is included in Google Fonts). It is used with a font-weight default value of 400. I need to change that to 300, but I can’t figure out how to do so.

    I’m using an Enfold-Child theme and in the Enfold Child Theme Options window the selcted fonts are “Lora” and “Lato” which I assume are the default choice (no sign of Ubuntu). I can’t find any reference to Ubuntu in any custom css file (neither style.css, nor custom.css), nor in the functions.php file.

    Looking at the HTML code of a page in Google Chrome I see this entry:
    <link rel=’stylesheet’ id=’googlefonts-css’ href=’http://fonts.googleapis.com/css?family=Ubuntu:400,700&subset=latin&#8217; type=’text/css’ media=’all’ />

    I’m unable to figure out what generates that line of code. I’d need to find it and change 400 to 300.

    Thanks in advance for the help.

    #667688

    add this here to your child-theme functions.php:

    add_filter( 'avf_google_heading_font',  'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Ubuntu'] = 'Ubuntu:400,300,300italic,400italic,500,500italic,700,700italic';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font',  'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    $fonts['Ubuntu'] = 'Ubuntu:400,300,300italic,400italic,500,500italic,700,700italic';
    return $fonts;
    }

    than you shoud have the choice on enfold options page – font to choose your Ubuntu (it is added at the end of the google fonts list on enfold )
    400 is the normal font-weight so i think you should not have the need to change something than.
    The rest is perhaps some quick.css (f.e. if you need the headings on 400 too – goto Enfold Options “Advanced Styling” and generate a rule for h1, h2, h3, h4, h5, h6 etc.)

    #667704

    Really appreciate your help!

    The font is now selectable in the enfold options page, but I’m still unable to set the font weight to 300.
    400 is “normal” but 300 is “light” and “light” is what I need.

    I’d like to have the “light” font weight as default for every text element. Could you suggest how to do this?

    #667710

    you can try this first on quick css:

    html * {
        font-family: "Ubuntu","HelveticaNeue","Helvetica Neue",Helvetica,Arial,sans-serif;
        font-weight: 300;
    }

    but there are a lot of inline css rules on enfold if you are working with alb (advanced layout editior)
    you than have to define an additional rule for that!

    f.e.

    #top h1 strong, #top h2 strong, #top h3 strong, #top h4 strong, #top h5 strong, #top h6 strong {
        font-weight: 300 !important;
    }

    i do not know if it is possible to map the 300 weight with the “normal”

    #667713

    I managed to do it. Thank you very much!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Change font attribute’ is closed to new replies.