For smart Primates & ROBOTS (oh and ALIENS ).

Blogroll

Tuesday, December 01, 2015

Remove version number from JS and CSS in WordPress

Problem:


How to Remove version number / querystring from JS and CSS in WordPress.

Solution:

goto your active theme folder and open functions.php file
and add below lines at the bottom.

function del_queryandversion_from_css_js( $style_or_js_url ) {
if ( strpos( $style_or_js_url, 'ver=' ) )
$css_js = remove_query_arg( 'ver', $style_or_js_url );
return $css_js;
}
add_filter( 'style_loader_src', 'del_queryandversion_from_css_js', 10 );
add_filter( 'script_loader_src', 'del_queryandversion_from_css_js', 10 );
Share:

0 comments:

Post a Comment

Multiple attribute passing in querySelectorAll

Multiple attribute passing in querySelectorAll     Here I am demonstrating code to how to pass multiple attributes in querySelectorAll. <...

Ads Inside Post

Powered by Blogger.

Arsip