• I am trying to enqueue two google fonts to a theme I am building. So far in the functions.php file I have the code:

    function google_fonts() {
    	$query_args = array(
    		'family'  =>  'Merriweather:400,700italic|Open+Sans:400,700,400italic,700italic',
    	);
    	wp_register_style( 'google_fonts', add_query_arg( $query_args, "//fonts.googleapis.com/css" ), array(), null );
    }

    add_action( ‘wp_enqueue_scripts’, ‘google_fonts’ );

    and I am using SASS:

    $sans-serif: 'Open Sans', Arial, sans-serif;

    $serif: ‘Merriweather’, serif;

    and an example of CSS is:

    `.quote p {
    font-family: ‘$serif’;
    font-size: 1.5em;
    line-height: 1.8em;
    font-style: italic;
    text-align: center;
    color: $primaryColor;
    padding: 0px 30px;
    }

    I can’t get the font “Merriweather” to work. Does anyone have any idea where I am going wrong?

  • The topic ‘enqueue google fonts’ is closed to new replies.