Enqueue custom font file with rel=”preload”

Question

I’m using a custom font on my WP site. It is now included with @font-face css attribute. But I’m wondering if there is any way to wp_enqueue this file with the attribute rel="preload" and may be some other attributes. So it looks something like this in browser:

<link rel="preload" href="/fonts/custom-font-folder/CustomFontFile.woff2" as="font" type="font/woff2" crossorigin="anonymous">

Thank you in advance.

0
, , anega 2 years 2019-11-29T03:23:31-05:00 0 Answers 123 views 0

Leave an answer

Browse
Browse