Guest User

Prevent caching of objects after settings change

a guest
Feb 10th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. Very Easy Method:
  2. In your theme’s function file (Appearance > Editor > Functions.php), add the following code before the closing PHP tag (%>) at the bottom of the file:
  3.  
  4. function _remove_script_version( $src ){
  5. $parts = explode( '?', $src );
  6. return $parts[0];
  7. }
  8. add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
  9. add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
  10.  
  11.  
  12. Visual : http://www.bilgedede.org
  13. Source: http://www.tricksmachine.com/2012/04/remove-query-strings-from-static-resources.html#comment-747724
Add Comment
Please, Sign In to add comment