Site logo

[Resolved] fonts.googleapis.com/css 400 Bad Request

Home Forums Support [Resolved] fonts.googleapis.com/css 400 Bad Request

Home Forums Support fonts.googleapis.com/css 400 Bad Request

Viewing 6 posts - 16 through 21 (of 21 total)
  • Author
    Posts
  • #1470724
    Gerva

    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 );
    #1470725
    David
    Staff
    Customer Support

    Glad to hear you found the issue.

    #1470726
    Gerva

    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

    #1470917
    Tom
    Lead Developer
    Lead Developer

    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.

    #1473614
    Gerva

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

    #1473765
    Tom
    Lead Developer
    Lead Developer

    No problem! Glad I could help 🙂

Viewing 6 posts - 16 through 21 (of 21 total)
  • You must be logged in to reply to this topic.