Error https://validator.w3.org google fonts

Home Forums Support Error https://validator.w3.org google fonts

Home Forums Support Error https://validator.w3.org google fonts

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #209140
    Sandro

    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,

    #209285
    Tom
    Lead Developer
    Lead Developer

    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 ๐Ÿ™‚

    #209426
    Sandro

    Hi, @tom function generate_add_more_fonts no works,

    Thks,

    Sandro

    #209449
    Tom
    Lead Developer
    Lead Developer

    It should, I built and tested it on my local server to make sure it works.

    How did you add it?

    #209531
    Sandro

    Work Perfect,

    Thks,

    Sandro

    #209621
    Tom
    Lead Developer
    Lead Developer

    You’re welcome ๐Ÿ™‚

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