Archived topic
Can't see the code in simple css
14 replies · Started by Annalena on May 2, 2021
Hi! When pasting this code in simple css and saving, it doesn't appear, where does it go?
<link rel="preload" as="script" href="script.js" />
<link rel="preload" as="style" href="style.css" />
<link rel="preload" as="image" href="img.png" />
<link rel="preload" as="video" href="vid.webm" type="video/webm" />
<link rel="preload" href="font.woff2" as="font" type="font/woff2" crossorigin />
Kind regards
Hi there,
You should insert that into a Hook Element: https://docs.generatepress.com/article/hooks-element-overview/
You'll want to put that in the wp_head area.
Let me know if you have any questions.
Thank you Stacey! I did this with another code a couple of days ago and have already forgotten how to do it. If I would like to see all my other questions I've asked you guys, is there a way to find them on your site? Was the code I pasted correct or does it need anything in front or at the end?
Thanks!
You can find your forum topics under your forum profile:
https://docs.generatepress.com/article/using-the-premium-support-forum/#forum-profile
Hi! Was the code I pasted correct or does it need anything in front or at the end?
<link rel="preload" as="script" href="script.js" />
<link rel="preload" as="style" href="style.css" />
<link rel="preload" as="image" href="img.png" />
<link rel="preload" as="video" href="vid.webm" type="video/webm" />
<link rel="preload" href="font.woff2" as="font" type="font/woff2" crossorigin />
Can you try if my site works in Canada? anleja.se
I think I have broken it when deleting some plugins.
Thanks!
The code looks fine to me.
This is the page I'm seeing:
https://www.screencast.com/t/T60lIkIbM0QC
Thank you Leo! I don't know who to ask so I'll ask you. Do you think WP Fastest cache is worth to test the premium version?
I have tried other plugin but they are far too complicated.
Best regards!
I can't comment on that unfortunately.
We only use Autopimize for our sites and no caching plugin:
https://docs.generatepress.com/article/configuring-autoptimize/
Hi! I'm sorry to bother you but I also have Autoptimize on my site, don't I need a cache plugin?
Thanks!
Hi there,
Autoptimize doesn't include a Cache - it simply optimizes the files.
Personally i leave Caching to the Server as theres less risk of one plugin interfering with another.
If you do choose to use a separate Cache Plugin such as WP Fastest Cache or WP Rocket then you must ensure that the two plugins DO NOT have the same options selected.
So if you have combine CSS files enabled in Autoptimze you should NOT enable it in the Cache plugin.
Hi! I couldn't find combine CSS file in Autoptimize. If I have WP fastest cache can I delete Autoptimize or vise versa? Or can I delete them both if my host provides cache?
What plugins do I really need? I have GP full package and I'm using Elementor and WooCommerce. I don't know which of all my plugins slow my site down. I should say that I need GP, Elementor and WooCommerce but have a lot of other plugins.
You're the best!
If your server has page caching then I personally would just use Autoptimize. You can see our recommended settings here:
https://docs.generatepress.com/article/configuring-autoptimize/
Hello! When looking at your fill in Autoptimize recommendation I see that you have written: seal.js,js/jquery/jquery.js, and in the CSS option: wp-content/cache/,admin-bar.min.css,dashicons.min.css, should I do that too?
Thanks!
That's our recommendation, follow or not, it's your personal choice :)