Skip to content

Instantly share code, notes, and snippets.

@pagelab
Forked from FernE97/typekit-enqueue.php
Created July 26, 2014 00:18
Show Gist options
  • Select an option

  • Save pagelab/0fedec1fe114e6a475b1 to your computer and use it in GitHub Desktop.

Select an option

Save pagelab/0fedec1fe114e6a475b1 to your computer and use it in GitHub Desktop.
<?php
function h5bs_enqueue_scripts() {
wp_enqueue_script( 'typekit', '//use.typekit.net/xxxxxxx.js' );
}
add_action( 'wp_enqueue_scripts', 'h5bs_enqueue_scripts' );
function h5bs_typekit_inline() {
if ( wp_script_is( 'typekit', 'done' ) ) {
echo '<script>try{Typekit.load();}catch(e){}</script>';
}
}
add_action( 'wp_head', 'h5bs_typekit_inline' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment