Skip to content

Instantly share code, notes, and snippets.

@digisavvy
Created December 6, 2021 19:36
Show Gist options
  • Save digisavvy/c3e63dd2147ec7679354e4ebc1856b37 to your computer and use it in GitHub Desktop.
Save digisavvy/c3e63dd2147ec7679354e4ebc1856b37 to your computer and use it in GitHub Desktop.
<?php
function dgs_preload_font() {
?>
<link rel="preload" href="<?php echo get_site_url(); ?>/wp-content/uploads/2021/10/calibre-web-light.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="<?php echo get_site_url(); ?>/wp-content/uploads/2021/10/calibre-web-regular.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="<?php echo get_site_url(); ?>/wp-content/uploads/2021/10/calibre-web-medium.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="<?php echo get_site_url(); ?>/wp-content/uploads/2021/10/calibre-web-light-italic.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="<?php echo get_site_url(); ?>/wp-content/uploads/2021/10/calibre-web-semibold.woff2" as="font" type="font/woff2" crossorigin>
<?php }
add_action( 'wp_head', 'dgs_preload_font' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment