Reply 196852 to: remove quary strings

Avatar: Olga Barlow
Olga Barlow
Support staff
July 17, 2018 at 15:11

Hello,

Use the code below, your code conflicts with the google fonts

// Remove query string from static files
function remove_cssjs_ver( $src ) {

    // Do not do it for revslider and essential-grid.
    if ( strpos( $src, 'revslider' ) || strpos( $src, 'essential-grid' ) ) return esc_url( $src );

    if( strpos( $src, '?ver=' ) )
        $src = remove_query_arg( 'ver', $src );
    return esc_url($src);
}

add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );

Regards

Go To The Whole Conversation In Topic
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.