Skip to content

How to preload theme icons woff files

Important

This is no longer required! The theme now uses SVG icons instead of a font family so your site icons are already well optimized for speed.

The following snippet can be used to automatically preload the theme's Icon Fonts.

add_action( 'wp_head', function() {
	echo '<link rel="preload" href="' . get_template_directory_uri() . '/assets/lib/ticons/fonts/ticons.woff2" type="font/woff2" as="font" crossorigin>';
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin.
We recommend Code Snippets (100% Free) or WPCode (sponsored)
Related Snippets
Back To Top