[Resolved] Problem adding a google font

Home Forums Support Problem adding a google font

  • This topic has 1 reply, 2 voices, and was last updated 1 year ago by Leo.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #991849
    Ghadeer

    I followed all topics in here, added this code to code snippets:

    add_filter( ‘generate_typography_customize_list’, ‘tu_add_google_fonts’ );
    function tu_add_google_fonts( $fonts ) {
    $fonts[ ‘Didact Gothic’ ] = array(
    ‘name’ => ‘Didact Gothic’,
    ‘variants’ => array( ‘400’, ‘500’, ‘700’ ),
    ‘category’ => ‘serif’
    );

    return $fonts;
    }

    And this to the css:

    body{
    font-family: ‘Didact Gothic’, sans-serif;
    }

    This was working without a problem when I had ‘Roboto’ instead of ‘Didact Gothic’ but there seems to be a particular problem with Didact Gothic, because it is falling back to sans-serif. If you could help me sort this out it would be great.

    #991867
    Leo
    Staff
    Customer Support

    Hi there,

    Copy and paste this instead:

    add_filter( 'generate_typography_customize_list', 'tu_add_google_fonts' );
    function tu_add_google_fonts( $fonts ) {
    	$fonts[ 'didact_gothic' ] = array( 
    		'name' => 'Didact Gothic',
    		'variants' => array( '400', '500', '700' ),
    		'category' => 'serif'
    	);
    
    	return $fonts;
    }

    The font should show up in the customizer under Typography > Body.

    Let me know if this helps 🙂

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