[Support request] Code snippet for adding a third google font

Home Forums Support Code snippet for adding a third google font

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1343260
    Laura

    Hi Team GP

    Following your documentation, I managed to add INTER and QUESTRIAL google fonts using Code snippets plugin.

    Using the same code, I have had no success with a third free google font Martel sans, however.

    here is the code:

    add_filter( ‘generate_typography_customize_list’, ‘tu_add_google_fonts’ );
    function tu_add_google_fonts( $fonts ) {
    $fonts[ ‘Martel_Sans’ ] = array(
    ‘name’ => ‘Martel Sans’,
    ‘variants’ => array( ‘200’, ‘300’, ‘400’, ‘500’, ‘600’),
    ‘category’ => ‘sans-serif’
    );

    return $fonts;
    }

    Adjusting the same code with Martel+Sans did not work either.

    Please advise
    Many thanks

    #1343378
    David
    Staff
    Customer Support

    Hi there,

    try this:

    add_filter( 'generate_typography_customize_list', 'martel_sans_add_google_fonts' );
    function martel_sans_add_google_fonts( $fonts ) {
    	$fonts[ 'martel_sans' ] = array( 
    		'name' => 'Martel Sans',
    		'variants' => array( '200', '300', '400', '500', '600' ),
    		'category' => 'sans-serif'
    	);
    
    	return $fonts;
    }
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.