Site logo

Archived topic

fonts.googleapis.com/css 400 Bad Request

20 replies · Started by Gerva on October 3, 2020

Viewing posts 16–21 of 21

Found
A snippet blocks the circulation.
Strange I've always used it but without problems with other themes.
This line
add_filter( 'style_loader_src', 'olgerva_cleanup_query_string', 15, 1 );

OK thank you very much sorry to bother you, I'll review the code.
Happy WeekEnd

function olGerva_cleanup_query_string( $src ){
	$parts = explode( '?', $src );
	return $parts[0];
}
add_filter( 'script_loader_src', 'olgerva_cleanup_query_string', 15, 1 ); 
add_filter( 'style_loader_src', 'olgerva_cleanup_query_string', 15, 1 );

Glad to hear you found the issue.

It was not a plugin but a code I use to clean WP Header, inserted with Code Snippets plugin, which I normally use.
This line,
add_filter( 'style_loader_src', 'olgerva_cleanup_query_string', 15, 1 );
because the rest does not create problems

Now I review the code line and try to understand why it blocks it.
Thanks again and have a nice day

That code removes query strings (anything after ? in a URL). This will remove version numbers from resources (its intention, but a bad idea), but it will also break things like Google fonts that use query strings for other reasons.

Ideally, I would just remove that function. It's going to cause headaches when it comes to cached resources, and it's not going to improve performance.

thank you very much for your answer
actually removed the function works the whole thing.
Thank you and excuse my little technical knowledge.

No problem! Glad I could help :)

This archived topic is closed to new replies.