Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
April 24, 2016 at 11:51 am #620767
Hello,
i want to try a individual font. I know how to use google fonts now (https://kriesi.at/support/topic/google-titillium-webfont-einbinden/) but i find no clue, were to put the code, which myfont gave me:
<script type="text/javascript"> (function() { var path = '//easy.myfonts.net/v2/js?sid=285408(font-family=Ciutadella+Slab+Medium)&sid=285409(font-family=Ciutadella+Slab+Semi+Bold)&sid=285410(font-family=Ciutadella+Slab+Regular)&sid=285412(font-family=Ciutadella+Slab+Light)&key=7XaQYsXgYw', protocol = ('https:' == document.location.protocol ? 'https:' : 'http:'), trial = document.createElement('script'); trial.type = 'text/javascript'; trial.async = true; trial.src = protocol + path; var head = document.getElementsByTagName("head")[0]; head.appendChild(trial); })(); </script>Can you help me please.
Kind regard,
DanielaApril 24, 2016 at 8:15 pm #620862Hi Daniela!
Please copy and add the below code in functions.php
function add_custom_code(){ ?> <script type="text/javascript"> (function() { var path = '//easy.myfonts.net/v2/js?sid=285408(font-family=Ciutadella+Slab+Medium)&sid=285409(font-family=Ciutadella+Slab+Semi+Bold)&sid=285410(font-family=Ciutadella+Slab+Regular)&sid=285412(font-family=Ciutadella+Slab+Light)&key=7XaQYsXgYw', protocol = ('https:' == document.location.protocol ? 'https:' : 'http:'), trial = document.createElement('script'); trial.type = 'text/javascript'; trial.async = true; trial.src = protocol + path; var head = document.getElementsByTagName("head")[0]; head.appendChild(trial); })(); </script> <?php } add_action('wp_head', 'add_custom_code');Cheers!
VinayApril 25, 2016 at 5:52 pm #621550That works. Thank´s a lot!!!
Cheers, Daniela
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
- The topic ‘Test individual font: code into head’ is closed to new replies.
