Last active
June 16, 2020 11:56
-
-
Save mihdan/31cd22e86cab489b92ceab49a08661bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Добавляем свой шрифт в тему асинхронно | |
* | |
* @link https://github.com/typekit/webfontloader | |
*/ | |
function mihdan_add_roboto_font() { | |
?> | |
<script type="text/javascript"> | |
WebFontConfig = { | |
classes: false, | |
events: false, | |
google: { | |
families: [ 'Roboto:400,700:cyrillic&display=swap' ] | |
} | |
}; | |
(function( d ) { | |
var wf = d.createElement('script'), | |
s = d.getElementsByTagName('script')[0]; | |
wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js'; | |
wf.async = true; | |
s.parentNode.insertBefore(wf, s); | |
})( document ); | |
</script> | |
<?php | |
} | |
add_action( 'wp_head', 'mihdan_add_roboto_font' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment