I've set up a WordPress site with one local font. It is stored in the a fonts
folder in the child theme. It is loaded with the following in the child theme style.css
@font-face {
font-family: 'Last Paradise';
src: url('fonts/LastParadise.eot');
src: url('fonts/LastParadise.eot?#iefix') format('embedded-opentype'),
url('fonts/LastParadise.woff2') format('woff2'),
url('fonts/LastParadise.woff') format('woff'),
url('fonts/LastParadise.ttf') format('truetype'),
url('fonts/LastParadise.svg#LastParadise') format('svg');
font-weight: normal;
font-style: normal;
}
The site has a CDN, which is currently activated by the bunny.net
CDN plug-in. Although I've tried various other options, such as the CDN Enabler
plug-in from KeyCDN, and also via the CDN options that are in various caching plug-ins I've tested.
In all cases, the above-mentioned font does not load from the CDN. It is called from the website URI.
I notice that there are a couple of other fonts that are loaded by plug-ins, and these also loading from the site URI not the CDN URI.
Questions
Is there a specific way to import/enqueue/reference a local font such that its URI will be picked up by a CDN plug-in, and thus converted to using the CDN URI when CDN is enabled? (I realise I could put in the full CDN based URI in the above
@font-face
CSS, but I'd like to know if there's a way to reference the font locally, such that when CDN is enabled then its URI will be converted to CDN URI.Is there a way to over-ride (like to de-enqueue and then re-enqueue) fonts that are being loaded by plug-ins? Such that I could force it to load from the CDN URI (by using the full CDN based URI when re-referencing it?)