[Support request] Load css below Critical CSS

Home Forums Support [Support request] Load css below Critical CSS

Home Forums Support Load css below Critical CSS

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #842265
    Anders Nielsen

    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?

    #842348
    David
    Staff
    Customer Support

    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.

    #842475
    Anders Nielsen

    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?

    #842776
    Tom
    Lead Developer
    Lead Developer

    What do you mean by fails? Do you get a specific error?

    #844061
    Anders Nielsen

    Parse error: syntax error, unexpected ‘;’, expecting ‘,’ or ‘)’ in /var/www/xxx.dk/xxx.dk/wp-content/themes/generatepress/functions.php on line 99

    #844321
    David
    Staff
    Customer Support

    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:

    https://docs.generatepress.com/article/adding-php/

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.