Before you ask please READ THIS

Preloader stuck

Hi,

I have problem with preloader image. Sometime (First visit, clear website Data etc.) preloader stuck. In preloader settings try When DOM ready and second setting but same problem. I think it’s problem in some optimization setting in function.php Like this

// Async js
function async_parsing_of_js( $url ) {
if ( is_user_logged_in() ) return $url; //don't break WP Admin
if ( FALSE === strpos( $url, '.js' ) ) return $url;
if ( strpos( $url, 'jquery.js' ) ) return $url;
return str_replace( ' src', 'async src', $url );
}
add_filter( 'script_loader_tag', 'async_parsing_of_js', 10 );

// Remove type='text/javascript' and style
add_filter('style_loader_tag', 'codeless_remove_type_attr', 10, 2);
add_filter('script_loader_tag', 'codeless_remove_type_attr', 10, 2);
function codeless_remove_type_attr($tag, $handle) {
return preg_replace( "/type=['\"]text\/(javascript|css)['\"]/", '', $tag );
}
4A786735-AEE9-4BB8-9560-D59C789529B8.png
2160 x 1620 - 101K

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!