Archived topic
Load css below Critical CSS
5 replies · Started by Anders Nielsen on March 18, 2019
Hi
When looking in the source code, I can see that the CSS is put before the critical CSS part.
I'm using autoptimize.
How to set the CSS file to load after the critical CSS so it won't be renderblocking?
Hi there,
might be worth you asking the Autoptimize developer, as it's his plugin doing that he would be better placed to advise. let me know.
ok, I found a solution from the developer..
But when I insert it ind the functions.php the site fails
https://wordpress.org/support/topic/how-can-i-send-the-concatenated-css-file-to-the-footer/
add_filter('autoptimize_filter_css_replacetag','te_css_replacetag',10,1;
function te_css_replacetag($replacetag) {
return array("</body>","before");
}
Do you any idea why?
What do you mean by fails? Do you get a specific error?
Parse error: syntax error, unexpected ';', expecting ',' or ')' in /var/www/xxx.dk/xxx.dk/wp-content/themes/generatepress/functions.php on line 99
Hi there,
can you remove it from your function file and try adding the code using the Code Snippets plugin, a link to which is provided in here: