Skip to content

Instantly share code, notes, and snippets.

@wpsmith
Forked from FernE97/typekit-enqueue.php
Created September 5, 2013 02:43
Show Gist options
  • Select an option

  • Save wpsmith/6445443 to your computer and use it in GitHub Desktop.

Select an option

Save wpsmith/6445443 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