Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #175278

    Hi,
    I read two threads on the forum (Adding Google Fonts (plural)&Google fotns with Extended Latin subset) and added code to functions.php (:

    
    add_filter( 'avf_google_heading_font',  'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Open Sans'] = 'Open+Sans&subset=latin,latin-ext';
    $fonts['Ubuntu Condensed'] = 'Ubuntu+Condensed&subset=latin,latin-ext';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font',  'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    $fonts['Open Sans'] = 'Open+Sans&subset=latin,latin-ext';
    $fonts['Ubuntu Condensed'] = 'Ubuntu+Condensed&subset=latin,latin-ext';
    return $fonts;
    }
    

    but it did not result any change. I checked on inspect and found that in enfold.css:1 that creates a line:
    font-family: 'Ubuntu+Condensed&subset=latin,latin-ext', 'HelveticaNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    instead
    font-family: 'Ubuntu Condensed', 'HelveticaNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif;

    In head section Google Font link is correct `<!– google webfont font replacement –>
    <link id=”google_webfont_1″ rel=”stylesheet” type=”text/css” href=”http://fonts.googleapis.com/css?family=Ubuntu+Condensed&subset=latin,latin-ext&#8221; /><style type=’text/css’>`

    How can I fix it?

    Regards
    Marek

    #175313

    Hi mad2k!

    Do you mind creating a temporary admin login and post it here privately?

    Best regards,
    Yigit

    #175323
    This reply has been marked as private.
    #175326
    This reply has been marked as private.
    #175612

    Hi!

    Please use following code – it should work

    
    add_filter( 'avf_google_heading_font',  'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Open Sans'] = 'Open Sans:400&subset=latin,latin-ext';
    $fonts['Ubuntu Condensed'] = 'Ubuntu Condensed:400&subset=latin,latin-ext';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font',  'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    $fonts['Open Sans'] = 'Open Sans:400&subset=latin,latin-ext';
    $fonts['Ubuntu Condensed'] = 'Ubuntu Condensed:400&subset=latin,latin-ext';
    return $fonts;
    }
    

    You can also load a different font weight – just replace 400 with another value. You can also load several weights (separate them with a comma like 400,700)
    Regards,
    Peter

    #175618

    Hi Peter,
    Thank you, so it is about HTML ASCII Characters conversion… will try today.

    Regards,
    Marek

    #175624
    This reply has been marked as private.
    #175626

    Hello!

    I corrected the code. It should work now. A ‘ sign was missing.

    Regards,
    Peter

    #175632

    Will try :-)
    Funny thing is that when I changed in register-admin-options.php line (291)
    $avia_elements[] = array( "name" => "Heading Font", and add line:
    ‘Ubuntu Condensed’=>’Ubuntu Condensed’,
    it works. I have no idea how? Magic? … but it is your answer :-)
    Marek

    #175643

    Hello Peter,

    I think I found a solution. I added your code in functions.php and additionaly add to

    Funny thing is that when I changed in register-admin-options.php line
    'Ubuntu Condensed'=>'Ubuntu Condensed&subset=latin,latin-ext',
    in $avia_elements[] = array( "name" => "Heading Font", and add line: section.

    Will test it later for more fonts and let you know.

    Regards,
    Marek

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Adding Google Fonts’ is closed to new replies.