{"id":1185,"date":"2013-04-02T15:33:26","date_gmt":"2013-04-02T06:33:26","guid":{"rendered":"http:\/\/www.santoshkori.com\/blog\/?p=1185"},"modified":"2013-04-02T15:33:26","modified_gmt":"2013-04-02T06:33:26","slug":"how-to-use-typekit-fonts-in-wordpress-theme","status":"publish","type":"post","link":"https:\/\/www.santoshkori.com\/blog\/how-to-use-typekit-fonts-in-wordpress-theme\/","title":{"rendered":"How to Use Typekit fonts in WordPress theme"},"content":{"rendered":"<p>Typekit is a useful service which allow you to use countless different fonts on your website or blog. They do provide a WordPress plugin to easily add their fonts to your WordPress site, but there\u2019s no built-in solution for integrating Typekit fonts directly to your theme. Here\u2019s a code to do it.\u00a0<!--more-->Assuming you don\u2019t want to use the TypeKit plugin, here\u2019s how to enqueue the scripts directly from your theme:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\r\n\/**\r\n * TypeKit Fonts\r\n *\r\n * @since Theme 1.0\r\n *\/\r\nfunction theme_typekit() {\r\n    wp_enqueue_script( 'theme_typekit', '\/\/use.typekit.net\/xxxxxxx.js');\r\n}\r\nadd_action( 'wp_enqueue_scripts', 'theme_typekit' );\r\n\r\nfunction light_typekit_inline() {\r\n  if ( wp_script_is( 'theme_typekit', 'done' ) ) { ?&gt;\r\n  \t&lt;script type=&quot;text\/javascript&quot;&gt;try{Typekit.load();}catch(e){}&lt;\/script&gt;\r\n&lt;?php }\r\n}\r\nadd_action( 'wp_head', 'theme_typekit_inline' );\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Typekit is a useful service which allow you to use countless different fonts on your website or blog. They do provide a WordPress plugin to easily add their fonts to your WordPress site, but there\u2019s no built-in solution for integrating Typekit fonts directly to your theme. Here\u2019s a code to do it.\u00a0<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,256,11,184],"tags":[548,554,552,549,551,553,550],"class_list":["post-1185","post","type-post","status-publish","format-standard","hentry","category-wordpress","category-wordpress-designer","category-wordpress-freelancer","category-wordpress-tip-and-tricks","tag-how-to-use-typekit-fonts-in-wordpress-theme","tag-typekit","tag-typekit-fonts","tag-typekit-fonts-in-wordpress-theme","tag-typekit-fonts-wordpress","tag-typekit-wordpress","tag-use-typekit-fonts-with-wordpress-theme"],"_links":{"self":[{"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/posts\/1185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/comments?post=1185"}],"version-history":[{"count":1,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/posts\/1185\/revisions"}],"predecessor-version":[{"id":1186,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/posts\/1185\/revisions\/1186"}],"wp:attachment":[{"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/media?parent=1185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/categories?post=1185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.santoshkori.com\/blog\/wp-json\/wp\/v2\/tags?post=1185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}