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

    So for the most part we can change the entire site to the Roboto font. However when it comes to the body text then there is a lack luster of choices for fonts. Roboto is not among them. We would like to add that font and the option to add Roboto Condensed.

    I found some forum posts about it and I tried them but unfortunately any time I try to add the filter to my functions.php it causes a php error and of course the site does not work.

    We are not using a child theme because the guy that I am building this site for does not want the child theme. :P

    I found this filter:

    add_filter( ‘avf_google_heading_font’, ‘avia_add_heading_font’);
    function avia_add_heading_font($fonts)
    {
    
    $fonts[‘Roboto Condensed’] = ”Roboto Condensed:300,300italic,400,400italic,700,700italic’;
    return $fonts;
    }
    
    add_filter( ‘avf_google_content_font’, ‘avia_add_content_font’);
    function avia_add_content_font($fonts)
    {
    
    $fonts[‘Roboto Condensed’] = ‘Roboto Condensed:300,300italic,400,400italic,700,700italic’;
    return $fonts;
    }

    Suggestions? Ideas? Also if I do want to add Roboto in addition to Roboto Condensed to the body text drop down how would I modify that above code.

    Thanks for your time.

    #658084

    Hi evan_friedl,

    Please send us a temporary admin login so that we can have a closer look. You can post the details in the Private Content section of your reply.

    Cheers!
    Rikard

    #658606

    Thought I sent this and I may have but my internets been acting up.

    #659259

    Hi,

    I added your code right below following line in functions.php file

    
    if(isset($avia_config['use_child_theme_functions_only'])) return;

    Please review your website now

    Best regards,
    Yigit

    #659497

    Thank you for your help. So what happens if I want more than one type of Roboto font? For example I want to add Regular Roboto to the content too.

    Thanks again for your help

    #659504
    #660003

    So does that mean its a brand new filter for each font you want to add?

    #660057

    Hey!

    You can edit/add lines in the code you already have

    $fonts['PT Sans'] = 'PT Sans:400,700,400italic,700italic';

    Best regards,
    Yigit

    #660094

    Yigit before the:

    return $fonts;

    depending on whether I need it in the heading or content?

    Thanks for answering my questions. :)

    #660870

    Hi,

    Yes, it would be as following

    add_filter( 'avf_google_heading_font', 'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['PT Sans Narrow'] = 'PT Sans Narrow:400,700';
    $fonts['PT Sans'] = 'PT Sans:400,700,400italic,700italic';
    $fonts['Raleway'] = 'Raleway:400,700';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font', 'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    
    $fonts['PT Sans'] = 'PT Sans:400,700,400italic,700italic';
    $fonts['PT Sans Narrow'] = 'PT Sans Narrow:400,700';
    $fonts['Raleway'] = 'Raleway:400,700';
    return $fonts;
    }

    Best regards,
    Yigit

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