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

    Hi–
    I added and activated the WP Google Fonts plugin but cannot get H1 to display the McLaren font. I added the code below (found in forums) but it still won’t show. I’d like ALL THE H tags to be McLaren.
    How do I override the template CSS?

    h1 { font-family: ‘McLaren’, sans-serif; }

    Thanks for any help—

    #476353

    Hi Cybernun!

    Our support for third party plugins is limited but you can get that font by altering the theme instead, add the following to your child themes functions.php:

    add_filter( 'avf_google_heading_font',  'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Source Sans Pro'] = 'Source Sans Pro:400,600,800';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font',  'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    $fonts['Source Sans Pro'] = 'Source Sans Pro:400,600,800';
    return $fonts;
    }

    You will have to replace the Source Sans Pro with the font you would like instead. After doing this it will be available in the menus in the backend.

    Regards,
    Rikard

    #478790

    I CANNOT ACCESS MY SITE NOW. I PUT IN THE CODE YOU SENT REPLACED WITH McClaren font and got this as an error:

    Parse error: syntax error, unexpected ‘function’ (T_FUNCTION) in /home/thenutro/public_html/nutsite/wp-content/themes/enfold/functions.php on line 151

    HELP!

    #478797

    I FTP’ed the original from the template and got it restored. Sure wish there was a simpler way of getting that Google font in there.

    #478989

    Hey!

    Yes there is a simpler way, you can hire a freelancer. If you don’t want to do that, here is the code nicely laid out for you to copy/paste, I even tried it myself to make sure that is works:

    add_filter( 'avf_google_heading_font',  'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['McLaren'] = 'McLaren';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font',  'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    $fonts['McLaren'] = 'McLaren';
    return $fonts;
    }

    Please add it to the bottom of your child themes function.php. Not using a child theme? Then please refer to this: http://kriesi.at/documentation/enfold/portfolio-item/create-a-child-theme/. If you don’t use a child theme you will have to make this change every time you update the theme.

    Best regards,
    Rikard

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