Archived topic
Error https://validator.w3.org google fonts
5 replies · Started by Sandro on July 13, 2016
Hi w3c validator error character pipe "|", recomend best practices chage nfc character '%7C',
Replace:
$google_fonts = implode('|', $google_fonts);
With:
$google_fonts = implode('%7C', $google_fonts);
Another thing as I can add more google fonts, <h4>, <h5>, <h6>, of course I define in the font-size in css, but as I get the source is imported by the theme generatepress addons typography from google.
Thks,
Sandro,
Hi there,
Currently, we use the format that Google Fonts suggests.
If you go to their website and add multiple fonts to your collection and get the embed code, you'll see them using the straight bar.
As for adding more fonts, you can filter them in:
add_filter( 'generate_typography_google_fonts','generate_add_more_fonts' );
function generate_add_more_fonts( $google_fonts )
{
return $google_fonts . '|Roboto|Lato';
}
Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/
Then just add your CSS:
h5 {
font-family: 'Roboto', sans-serif;
}
Hope this helps :)
Hi, @tom function generate_add_more_fonts no works,
Thks,
Sandro
It should, I built and tested it on my local server to make sure it works.
How did you add it?
Work Perfect,
Thks,
Sandro
You're welcome :)
