Guest User

Untitled

a guest
Jan 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. // Typekit
  2. add_action( 'wp_enqueue_scripts', 'prefix_enqueue_scripts' );
  3. /**
  4. * Loads the main typekit Javascript. Replace your-id-here with the script name
  5. * provided in your Kit Editor.
  6. *
  7. * @todo Replace prefix with your theme or plugin prefix
  8. */
  9. function prefix_enqueue_scripts() {
  10. wp_enqueue_script( 'typekit', '//use.typekit.net/pnp6xul.js', array(), '1.0.0' );
  11. }
  12. add_action( 'wp_head', 'prefix_typekit_inline' );
  13. /**
  14. * Check to make sure the main script has been enqueued and then load the typekit
  15. * inline script.
  16. *
  17. * @todo Replace prefix with your theme or plugin prefix
  18. */
  19. function prefix_typekit_inline() {
  20. if ( wp_script_is( 'typekit', 'enqueued' ) ) {
  21. echo '<script type="text/javascript">try{Typekit.load();}catch(e){}</script>';
  22. }
  23. }
Add Comment
Please, Sign In to add comment