Hey….i would like to defer js files and i have tried to use following code in my function.php
function defer_parsing_of_js ( $url ) {
if ( FALSE === strpos( $url, ‘.js’ ) ) return $url;
if ( strpos( $url, ‘jquery.js’ ) ) return $url;
return “$url’ defer “;
}
add_filter( ‘clean_url’, ‘defer_parsing_of_js’, 11, 1 );
But with this code all xstore shortcodes are broken in their appearance…..
Is there any hint to solve that problem?? Maybe any code to exclude the js files of the theme?
Thanks a lot