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

    Hi there

    Is there a way (via plugin or?) to add many Google fonts to the Enfold Theme without having to manually add each one in functions.php?

    Thanks in advance!

    Justin

    #582091

    Hey Justin,

    Maybe a plugin like this could help you out? https://wordpress.org/plugins/wp-google-fonts/

    Regards,
    Rikard

    #582459

    Yes but that doesn’t then allow me to choose them in the Enfold panel??

    #582464

    Hi!

    You would need to use custom CSS code. We still think it is better to add custom code to functions.php file. If you need help with it, we can gladly help :)

    Best regards,
    Yigit

    #582471

    Ah ok yes i’d rather do something properly. I basically would like to add quite a lot of Google fonts so that I can choose in the drop down control panel which one’s to use.

    For example in the first instance how would I add ‘Source Sans Pro’?

    Best

    Justin

    #582484

    Hi!

    Please add following code to Functions.php file in Appearance > Editor

    add_filter( 'avf_google_heading_font', 'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Source Sans Pro'] = 'Source Sans Pro:400,700,400italic,700italic';
    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,700,400italic,700italic';
    return $fonts;
    }

    Regards,
    Yigit

    #582486

    Thank you! Whereabouts in the functions.php code should i place this?

    #582493

    Hey!

    You can add it somewhere near top :)

    Cheers!
    Yigit

    #582504

    Many thanks that is great. Do you know how i can specify font weights? For example if i wanted Light 300 for the body font?

    #583397

    Hey!

    “400,700,400italic,700italic” in the code is font weight and font styles. You can adjust it to add additional font weights :)

    Regards,
    Yigit

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