yan-k
10/26/2016 - 6:28 AM

Using Adobe TypeKit and Google Fonts with WordPress

Using Adobe TypeKit and Google Fonts with WordPress

<?php

function yanco_scripts() {
    if( !is_admin() ) {

	    	$query_args = array(
				'family' => 'Open+Sans:300,500,700',
				'subset' => 'latin,latin-ext',
				
				wp_register_script( 'adobe-typekit', 'https://use.typekit.net/jkr3fxw.js');
			  wp_enqueue_script( 'adobe-typekit' );
			  
			  wp_register_style( 'yanco-google-fonts', add_query_arg( $query_args, "//fonts.googleapis.com/css" ), array(), null );
			  wp_enqueue_style('yanco-google-fonts' );

		  );
    }
}
add_action( 'wp_enqueue_scripts', 'yanco_scripts' );