• Welcome to the all-new Kolakube support, the official place to get help for Marketers Delight, XFtoWP, CryptoWP, and other WordPress products! Please login with your account details to access members-only support forums.

Resolved Is there a filter to set the imported font to "font-display: swap;"?

Andro

Active member
Md
XFtoWP
Messages
72
Reaction score
84
Is there a filter to set the imported font to font-display: swap;?

/wp-content/plugins/XFWP/lib/icons/xfwp-icon.woff2

I am preloading it from Perfmatters, but I think it would improve performance if it was set to "swap".

More details:


MotmJMG.png
 
Solution
You can add a simple line to /wp-content/plugins/XFWP/lib/css/XFWP.css. At the top find:

CSS:
@font-face {
    font-family: 'xfwp-icon';
    src: url('../icons/xfwp-icon.eot');
    src: url('../icons/xfwp-icon.eot?53204155#iefix') format('embedded-opentype'),
         url('../icons/xfwp-icon.woff2') format('woff2'),
         url('../icons/xfwp-icon.woff') format('woff'),
         url('../icons/xfwp-icon.ttf') format('truetype'),
         url('../icons/xfwp-icon.svg#xfwp-icon') format('svg');
}

and change it to:

CSS:
@font-face {
    font-display: swap;
    font-family: 'xfwp-icon';
    src: url('../icons/xfwp-icon.eot');
    src: url('../icons/xfwp-icon.eot?53204155#iefix') format('embedded-opentype')...
You can add a simple line to /wp-content/plugins/XFWP/lib/css/XFWP.css. At the top find:

CSS:
@font-face {
    font-family: 'xfwp-icon';
    src: url('../icons/xfwp-icon.eot');
    src: url('../icons/xfwp-icon.eot?53204155#iefix') format('embedded-opentype'),
         url('../icons/xfwp-icon.woff2') format('woff2'),
         url('../icons/xfwp-icon.woff') format('woff'),
         url('../icons/xfwp-icon.ttf') format('truetype'),
         url('../icons/xfwp-icon.svg#xfwp-icon') format('svg');
}

and change it to:

CSS:
@font-face {
    font-display: swap;
    font-family: 'xfwp-icon';
    src: url('../icons/xfwp-icon.eot');
    src: url('../icons/xfwp-icon.eot?53204155#iefix') format('embedded-opentype'),
         url('../icons/xfwp-icon.woff2') format('woff2'),
         url('../icons/xfwp-icon.woff') format('woff'),
         url('../icons/xfwp-icon.ttf') format('truetype'),
         url('../icons/xfwp-icon.svg#xfwp-icon') format('svg');
}

Let me know if that helps with passing the test. It is an easy enough change that I will include in the upcoming 1.5.4 release.
 
2 Comments
Andro
Andro commented
Alex
Alex commented
...yep. Patching now.
 
Solution
Back
Top