如何在Wordpress的AMP页面上排除某个功能?
if (!(is_admin() && is_amp_endpoint())) {
function defer_parsing_of_js ( $url ) {
if (FALSE === strpos ($url, '.js'))) return $url;
if (strpos ($url, 'jquery.js'))) return $url;
return "$url defer=\ " defer\"";
}
add_filter ('clean_url', 'defer_parsing_of_js', 11, 1 );
}
为什么此代码在AMP页面上有效?如何解决?