• Resolved WPO

    (@ivanpr)


    Thank you for a great plugin.

    I have request/support question to discuss here.
    Our website has a critical inline CSS and non-critical CSS that is called in the footer of the website, but when I use Autoptimize it merges all the CSS files and loads it in the header above the Critical CSS.

    This messes CSS rules order and results in Render Blocking CSS notices in PageSpeed.

    I do know that ‘Inline and Defer CSS?’ setting places CSS file request in the head but defers it, BUT I would like to suggest adding an option to simply load combined CSS in the footer of the website [though it is incorrect in HTML5].

    Can this be done?

    Thank you.

    • This topic was modified 5 years, 6 months ago by WPO.
Viewing 1 replies (of 1 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    yes, using the API, with e.g. below code snippet;

    add_filter('autoptimize_filter_css_replacetag','ivan_css_replacetag',10,1);
    function ivan_css_replacetag($replacetag) {
    	return array("</html>","before");
    	}

    using that you can target any tag in your HTML and specify if the CSS should be injected before or after it.

    hope this helps,
    frank

Viewing 1 replies (of 1 total)

The topic ‘CSS in Footer’ is closed to new replies.