WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. bolt24
    Member
    Posted 6 months ago #

  2. Your WP Expert
    Member
    Plugin Author

    Posted 6 months 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 6 months ago #

    Thanks man.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.