Support » Theme: Twenty Seventeen » Can’t get added font to show

  • Hi,

    I have added a new font to the child theme, that I can’t get to be shown on the website:

    1. The child-theme:

    twentyseventeen-child/fonts/jellyka_cuttycupcakes-webfont.woff
    twentyseventeen-child/fonts/jellyka_cuttycupcakes-webfont.woff2

    2. The child-theme stylesheet:

    @font-face { font-family: 'jellyka_cuttycupcakesregular';
       	 src: url('/fonts/jellyka_cuttycupcakes-webfont.woff2') format('woff2'),
             url('/fonts/jellyka_cuttycupcakes-webfont.woff') format('woff');
       	 font-weight: normal;
        	 font-style: normal; }

    `p.site-description { font-family: ‘jellyka_cuttycupcakesregular’, Arial, sans-serif !important; }

    Would very much appreciate your help.

    Best regards,
    Cecilia

Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator stephencottontail

    (@stephencottontail)

    What’s probably happening here is that the relative URL you’re using to point to the font files is starting from the wrong place. You’ll need to use something like:

    src: url('/wordpress/wp-content/themes/twentyseventeen-child/fonts/jellyka_cuttycupcakes-webfont.woff2')

    instead.

    Thank you for your help. Unfortunately, it didn’t work. Is it a CORS issue? I have now uppdated the .htaccess file and added:

    <FilesMatch ".(eot|ttf|otf|woff|woff2)">
      Header set Access-Control-Allow-Origin "*"
    </FilesMatch>

    The font does not yet show, so I’m still at a loss knowing what to do next… 🙂

    Do you have any tips for this kind of issue?

    Thanks in advance.

    Moderator stephencottontail

    (@stephencottontail)

    Oops, I forgot to subscribe to this thread, so I didn’t get an email notification. Sorry about that.

    It’s probably not a CORS issue. Can you post a link to your site?

    No problem.

    The site is, however, password-protected right now: digital-balans.se

    Can I send the login details to you separately in some way?

    The tagline can be seen in Firefox right now, but not at all in Chrome, still with the default font-type (not the one that I want to change to, that is).

    Moderator stephencottontail

    (@stephencottontail)

    No, please don’t send me (or anyone else) any kind of login details. Can you post the full code that you’re using in your child theme’s stylesheet to Pastebin and post the link here?

    The child theme’s css is published at pastebin now: digital-balans

    Moderator stephencottontail

    (@stephencottontail)

    Your link didn’t seem to come through correctly; can you try posting it again?

    Moderator stephencottontail

    (@stephencottontail)

    I’m sorry, but I can’t seem to reproduce your issue at all, and if it’s not possible for you to make your site public, then I’m not sure how much more help I can give. Can you verify that the font file itself is being loaded correctly (i.e., are you receiving a 404 error when you check the site using a web inspecting tool)?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Can’t get added font to show’ is closed to new replies.