-
AuthorPosts
-
August 3, 2016 at 1:44 pm #668012
Dear Support Team,
I want to install a Typekit font on my website. There are a Typekit plugin for WordPress. Here I can not embed the extended code unfortunately. but I need the extended code, otherwise FOUT effect happens.
I have read on the website of Adobe Typekit that the expanded code to insert at the top of the <head> tag. Here I do not know further. Can you tell me where I need to add in the extended code? Or which way should I go?
This is the code:
<script> (function(d) { var config = { kitId: 'XXXXX', scriptTimeout: 3000, async: true }, h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s) })(document); </script>
Many thanks!
Katrin- This topic was modified 8 years, 4 months ago by LorbeerDesign.
August 8, 2016 at 2:28 pm #669823Hey LorbeerDesign!
Please try adding following code to Functions.php file in Appearance > Editor
function typekit_header_code(){ ?> <script> (function(d) { var config = { kitId: 'XXXXX', scriptTimeout: 3000, async: true }, h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s) })(document); </script> <?php } add_action('wp_head', 'typekit_header_code');
Regards,
YigitAugust 11, 2016 at 2:41 pm #671340Hi Yigit,
many thanks for your response. I trust not to edit the functions.php. Can you briefly to see screenshot, whether it is right? I do not think so.
Where the code must be accurately placed for?best regards :-)
August 11, 2016 at 2:57 pm #671356August 30, 2016 at 9:25 am #679289Hi Yigit,
Sorry for the late answer. I have the code embedded below.
Unfortunately, it does not affect my work. This does not appear.What am I doing wrong?
Thanks for your help Yigit!
best regardsAugust 30, 2016 at 10:07 am #679303Hi Yigit,
I did it. This site is the description:
I have added the following CSS.
.wf-loading body { font-family: "ff-meta-web-pro",sans-serif; visibility: hidden; } .wf-active body { font-family: "ff-meta-web-pro",sans-serif !important; visibility: visible; }
Now I see no FOUT-effect more.
Thank you nevertheless for your help!
best regards -
AuthorPosts
- The topic ‘Typekit font FOUT-effect’ is closed to new replies.