WordPress.org

Forums

Remove Query Strings From Static Resources
[resolved] Exclude a css-file from being stripped (3 posts)

  1. bolt24
    Member
    Posted 1 year ago #

  2. Your WP Expert
    Member
    Plugin Author

    Posted 1 year ago #

    Sorry, this is option is not available in this version of the plugin.

    But if you know some basic php you can use this code in your functions.php file instead of the plugin.

    Just replace this link with yours: http://fonts.googleapis.com/css?family=Amaranth&ver=3.5

    function _remove_script_version( $src ){
    	$excludes = array(
    		'http://fonts.googleapis.com/css?family=Amaranth&ver=3.5',
    	);
    	$result = $src;
    	if ( ! in_array($src, $excludes) ) {
    		$parts = explode( '?ver', $src );
    		$result = $parts[0];
    	}
    	return $result;
    }
    add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
    add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
  3. bolt24
    Member
    Posted 1 year ago #

    Thanks man.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Remove Query Strings From Static Resources
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.