Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Frank Goossens

    (@futtta)

    you can change the place the optimized JS is inserted using the API, cfr. the example code in autoptimize_helper.php_example;

    add_filter('autoptimize_filter_js_replacetag','my_ao_override_js_replacetag',10,1);
    function my_ao_override_js_replacetag($replacetag) {
            return array("<injectjs />","replace");
            }

    the default is array("</head>","before");, but you could change that into for example array("</title>","after");?

    hope this helps,
    frank

    Thread Starter veljkovex

    (@veljkovex)

    Ty for the quick reply Frank, but i didn’t really get what you wanted to say.

    What part of the function that you put, should i change to array(“</title>”,”after”);?

    Thread Starter veljkovex

    (@veljkovex)

    Can you explain it in more detail?

    Thread Starter veljkovex

    (@veljkovex)

    I figured it out, put it in the function.php, but it didn’t solve my problem. But ty anyway. Have a nice day.

    Plugin Author Frank Goossens

    (@futtta)

    well, you could also do
    array("<title>","before");
    or
    array("<head>","after");
    or …

    but the best place to inject depends on your specific context off course ??

    frank

    Thread Starter veljkovex

    (@veljkovex)

    Hello Frank,

    Can you also give me the function for the css move?
    The above solution worked on some site, so i want to give it a try for the css as well.

    Or even better, is there a way to move the excluded css files? Because i can’t optimize them, but on google speed test, they still make render-blocking css?

    Plugin Author Frank Goossens

    (@futtta)

    that would be autoptimize_filter_css_replacetag, using the same approach ??

    frank

    Thread Starter veljkovex

    (@veljkovex)

    ok, thanks ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Loading order’ is closed to new replies.