CCDzine
9/24/2015 - 10:03 AM

Enqueue TypeKit in WordPress

Enqueue TypeKit in WordPress

<?php
function ccd_theme_typekit() {
    wp_enqueue_script( 'theme_typekit', '//use.typekit.net/xxxxxxx.js');
}
add_action( 'wp_enqueue_scripts', 'ccd_theme_typekit' );

function ccd_theme_typekit_inline() {
  if ( wp_script_is( 'theme_typekit', 'done' ) ) { ?>
  	<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
<?php } }
add_action( 'wp_head', 'ccd_theme_typekit_inline' );
?>

Enqueue TypeKit

WordPress Snippet