I am trying to add a preload tag to the custom font liquid code below.
@font-face {
font-family: ‘Wild Wolf’;
src: local(‘Wild Wolf’), url(‘https://cdn.shopify.com/s/files/1/0625/6872/6713/files/Wild_Wolf.woff2?v=1661833383’) format(‘woff2’);
}
I have uploaded the .woff2 file to Shopify Files and it is also in my assets if that is better to pull from.
How can I add a preload tag and should I use the shopify files reference like I currently am or should I be using the asset_url reference?
My url is https://untamedtallow.com/
My goal is to speed up the loading of the word UNTAMED on my home page.
hi @untamedtallow
Its SideNode! We will be happy to help you today.
You can try this code: it will be helpful to you
-
Add a preload tag to your HTML document’s section:
Go to the Online Store->Theme->Edit code->theme.liquid>Add this code just before closing the tag.
@font-face { font-family: 'Wild Wolf'; src: local('Wild Wolf'), url('https://cdn.shopify.com/s/files/1/0625/6872/6713/files/Wild_Wolf.woff2?v=1661833383') format('woff2'); }
If I was able to assist you, please remember to give it a Like and Mark it as the Solution!
Let me know if need further assistance
Regards,
SideNode
This looks like it’s the solution, could you just clarify what you mean by “Add this code just before closing the tag.”? I added it right after the tag and it seems to be working.
I don’t think so. What does this mean - “Add this code just before closing the tag.”