Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #718748

    I want to add the Google Font “Open Sans Light”

    So I add this to functions.php:

    add_filter( 'avf_google_heading_font',  'add_custom_open_sans');
    add_filter( 'avf_google_content_font',  'add_custom_open_sans');
    function add_custom_open_sans($fonts) {
    	$fonts['Open Sans Light'] = 'Open+Sans:300';
    	return $fonts;
    }
    

    an this to my css:

    #top .entry-content-wrapper h1 {
    text-transform: none;
     font-weight:300 !important;   
     font-size:40px;
     font-family:'Open Sans Light', sans-serif !important;  
     color:#58585a;
    }
    

    But the font didn’t show up. What’s wrong?

    #719125

    Hey mdorfi,

    Please try this instead:

    add_filter( 'avf_google_heading_font',  'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Open Sans Light'] = 'Open Sans:300';
    return $fonts;
    }

    If that doesn’t work then please post a link to the site in question and we’ll have a closer look.

    Best regards,
    Rikard

    #719192

    I got it to work. I forgot to add the following to header.php:

    
    <link href="https://fonts.googleapis.com/css?family=Open+Sans:300" rel="stylesheet">
    
    • This reply was modified 7 years, 4 months ago by mdorfi.
    #719493

    Hi,

    Ah ok, great. Glad you got working and thanks for sharing :-)

    Please let us know if you should need any further help on the topic.

    Best regards,
    Rikard

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