-
hammerguyParticipant
Hey, thanks for excellent theme!!
For Google speed insights, I need to move the stylesheet and JS content appearing via <?php wp_head()?> to footer. I assume that CSS and JS files are registered for head and that’s why I can’t move them to footer. I just want to do that, so that my site loads blazing fast.
Please help me to let your theme reach millions of readers. Ty in advance.
Daniel TaraKeymasterI wish I could help you but you have a poor understanding of how this works. Moving the stylesheet to the footer wouldn’t make any difference since the browser doesn’t display the page before all stylesheets have been parsed. What Google PageSpeed recommends is to add a minimal stylesheet in the head section that renders the fold and load the rest of the styles asynchronously. This is a much too complicated procedure to be discussed here. This article explains the basics of how this is done and you may also find this articlethis article useful.
The only JS that is added to the header is jQuery. It is added by WordPress coreto the head section in order not to break functionality. You could manually move it to the footer but that could break some plugins and core features. my recommendation is to use a plugin like Better WordPress MinifyBetter WordPress Minify.
hammerguyParticipantThanks for your prompt reply. However, when I run the page speed test, it says there are some render blocking resources. The JS is render blocking since and if we add async=”async” it passes the test. For CSS, if it is placed in example.com/style.css rather than example.com/wp-content/themes/enlightenment/style.css scores more.
So at last my question is how does I load the CSS with example.com/style.css after removing it from wp_head. Sorry but I m much concerned about. I hope you’ll have a solution.
Thanks,
Best regards.
You must be logged in to reply to this topic.