I also tried using a plugin that was recommended (which I would rather not do) and it didn’t work either. Anyone have a snippet that will do this in the current version of wordpress?
/* Remove Query String from Static Resources */
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
Good looking out. This goes right into the functions.php file right? Does it matter where?
Goes into the child theme’s functions.php file anywhere after the opening <?php
tag, below the last function (if you have other) it’s OK.
This doesn’t seem to work. All the query strings are still on my js and css files.
@jeremyers1 – if you aren’t the O.P. with another profile – and unless you are using the same version of WordPress on the same physical server hosted by the same hosts with the same plugins, theme, and configurations as the original poster, do not post in someone else’s thread. Start your own topic.
https://codex.wordpress.org/Forum_Welcome#Where_To_Post
Sorry I never replied to this string. This worked great. Thanks @tizz. You are a star. This stuff can be so daunting.
You’re welcome. Please, mark this as resolved.
I used the code and it worked but, it did something to my fonts, everything written looks different even the colors of it, padding is wierd too,
anyone experienced this?
Thank you
-
This reply was modified 8 years, 3 months ago by ma001.