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

    (@futtta)

    yeah, with a couple of lines of code against AO’s API, somethink like this (warning, untested, I’m not “in the office” this week);

    add_filter('autoptimize_filter_noptimize','optimize_home',10,0);
    function optimize_home() {
    	if ( is_home() || is_front_page() ) {
    		return false;
    	} else {
    		return true;
    	}
    }

    hope this helps,
    frank

    Thread Starter giorgosnl

    (@giorgosnl)

    Indeed that worked fine. Thanks for your prompt response frank

    Hi Frank!
    Thanks for this plugin, I think it works really well and is an important one to use ??

    I have a similar question. Is it possible to only inject the critical CSS on the homepage?
    The filter above does that, but the scripts and styles is not concatenated, which I still want them to be.

    Thanks!

    Plugin Author Frank Goossens

    (@futtta)

    I *think* this might work (no time to test myself now);

    add_filter('autoptimize_filter_css_defer','defer_home',10,0);
    function defer_home() {
    	if ( is_home() || is_front_page() ) {
    		return true;
    	} else {
    		return false;
    	}
    }

    frank

    Worked like a charm! Thanks Frank!

    Plugin Author Frank Goossens

    (@futtta)

    Gotta love those filters ??

    Where are you adding this script?

    Edit: Nevermind I got it :p

    Plugin Author Frank Goossens

    (@futtta)

    ?? ??

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