Home › Forums › Support › Google Fonts and W3C Validator error › Reply To: Google Fonts and W3C Validator error
July 29, 2016 at 9:55 am
#213879
Tom
Lead Developer
Lead Developer
Hi there,
I’m not sure if it will work, as Google specifically suggests using the pipe in their example code they supply you. I assume they do this for a reason.
You can convert them using this function:
add_filter( 'generate_typography_google_fonts','tu_convert_font_pipes', 100 );
function tu_convert_font_pipes( $google_fonts ) {
return str_replace( '|', '%7C', $google_fonts );
}
Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/