• I am having trouble viewing one of the fonts in my Adobe Typekit on my new GeneratePress installation. I added the kit according to Adobe’s instructions:

    “To use these fonts on a web page, copy this code into the <head> tag of your HTML.
    You can embed this project on any website you manage.”

    <link rel=”stylesheet” href=”https://use.typekit.net/trl3fol.css”&gt;

    I put it in the Theme Header (header.php) file as such:

    <head>
    <meta charset=”<?php bloginfo( ‘charset’ ); ?>”>
    <meta http-equiv=”X-UA-Compatible” content=”IE=edge” />
    <link rel=”profile” href=”https://gmpg.org/xfn/11″&gt;
    <?php wp_head(); ?>
    <link rel=”stylesheet” href=”https://use.typekit.net/trl3fol.css”&gt;
    </head>

    Which in theory should have worked but it didn’t. Oddly in the Customize Typography section there is no option to choose either one of the fonts in my Adobe TypeKit.

    So, I had to add them Addition CSS section of the Customizer section as such:

    body {
    font-family: “futura-pt-1”, sans-serif;
    }
    h1,h2,h3,h4,h5,h6 {
    font-family: “ltc-bodoni-175, serif”;
    font-weight: 400;
    font-style: normal;
    }

    Oddly, only Futura showed up in the body text, but Bodoni did not.

    I checked Firefoxe’ Inspect Element and indeed Bodoni is there like this:

    h1, h2, h3, h4, h5, h6 {
    font-family: “ltc-bodoni-175, serif”;
    font-weight: 400;
    font-style: normal;
    }

    In trying to find the answer I read in the support documents on GP’s website, there were two methods suggested for where to put one’s Typekit, either in the wp_footer or the wp_header (https://generatepress.com/forums/topic/typekit-woes/). But as someone in the forum questioned (#645600), why are Adobe’s instructions for adding the Typekit different than GeneratePress’?

    BTW, why are we always told to create Child Themes when we are allowed to add custom CSS to the Additional CSS section of GeneratePress’ Customizer?

    Thanks,

    Mollie

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter molliem

    (@molliem)

    The site isn’t live yet.

    Theme Author Tom

    (@edge22)

    Hi Mollie,

    That should work, but there’s one more step you need to take in order for the font to show up in the Customizer.

    add_filter( 'generate_typography_default_fonts', function( $fonts ) {
        $fonts[] = 'proxima-nova';
    
        return $fonts;
    } );

    That code can be added using one of these methods: https://docs.generatepress.com/article/adding-php/

    proxima-nova should be changed to the name of your font.

    Also, you should add the typekit link using a function as well, so you don’t need to edit the core theme files:

    add_action( 'wp_head', function() {
        ?>
        <link rel="stylesheet" href="https://use.typekit.net/trl3fol.css">
        <?php
    } );

    A child theme is helpful if you need to change template files.

    Let me know if the above helps or not 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Typekit Troubles’ is closed to new replies.