Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1006238

    Hi there,
    I realize that this will affect page load, but we need to activate a third google font to the site. Currently I have the heading font set to Oswald and the body text set to Roboto. I need to add Droid Serif to this activated fonts list. I can’t seem to find the right code through other forum posts. Can you please advise?

    Thanks!

    #1006285

    Hey kristenangel,

    You can add the font to the function that you’re using already.

    Can you show us the code you’re using?

    Did you upload the Droid font already?

    Best regards,
    Victoria

    #1006350

    Droid Serif is already in the dropdown list of fonts available to the theme, so I shouldn’t need to upload a second version, correct?

    Regardless, I have this in my functions file:

    add_filter( 'avf_google_heading_font',  'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Droid Serif'] = 'Droid Serif:400';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font',  'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    $fonts['Droid Serif'] = 'Droid Serif:400';
    return $fonts;
    }

    And am using !important to the text css to try and override the theme choice fonts, but not having any luck.

    Thanks~

    • This reply was modified 6 years, 3 months ago by kristenangel.
    #1006440

    Hi,

    You have to add the font manually. This article should help.

    // https://www.wpbeginner.com/wp-themes/how-add-google-web-fonts-wordpress-themes/

    function wpb_add_google_fonts() {
    
    wp_enqueue_style( 'wpb-google-fonts', 'http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,700,300', false ); 
    }
    
    add_action( 'wp_enqueue_scripts', 'wpb_add_google_fonts' );
    
    

    Best regards,
    Ismael

    #1006696

    Thank you Ismael, this worked.

    #1006727

    Hi kristenangel,

    Glad we could help :)

    If you need further assistance please let us know.
    Best regards,
    Victoria

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