Skip to content

Instantly share code, notes, and snippets.

@gareth-gillman
Created March 8, 2018 17:46
Show Gist options
  • Save gareth-gillman/b2788c3f481eb1585975093598d06f43 to your computer and use it in GitHub Desktop.
Save gareth-gillman/b2788c3f481eb1585975093598d06f43 to your computer and use it in GitHub Desktop.
WordPress Preconnect Google Fonts
function gg_gfonts_prefetch() {
echo '<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>';
echo '<link rel="preconnect" href="https://fonts.googleapis.com/" crossorigin>';
}
add_action( 'wp_head', 'gg_gfonts_prefetch' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment