I’m trying to improve the page loading speed of my site.
GTmetrix says I need to address ‘defer parsing of JavaScript.’
I’ve tried different plugins, but this hasn’t worked.
It was suggested I paste the following into ‘Theme functions’ section of Tempera theme:
/**
* Defer parsing of javascript.
*/
if (!(is_admin() )) {
function defer_parsing_of_js ( $url ) {
if ( FALSE === strpos( $url, ‘.js’ ) ) return $url;
if ( strpos( $url, ‘jquery.js’ ) ) return $url;
// return “$url’ defer “;
return “$url’ defer onload='”;
}
add_filter( ‘clean_url’, ‘defer_parsing_of_js’, 11, 1 );
}
But this hasn’t worked either.
can you please advise on how best to resolve this issue.
Thank you very much
Francis
Website: message-matters.com