I’m trying to enqueue a typekit on my WP site in a function using code below:
/**
* TypeKit Fonts
*
* @since Theme 1.0
*/
function theme_typekit() {
wp_enqueue_script( 'theme_typekit', '//use.typekit.net/xxxxxxx.js');
}
add_action( 'wp_enqueue_scripts', 'theme_typekit' );
function 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', 'theme_typekit_inline' );
Code appears to be working fine, however when url called on frontend it’s showing 404 in console for link, https://use.typekit.net/xxxxxxx.js
Any idea why not found? Note, I’m using a valid typekit code on my end.