[Resolved] Frackin' relative URLs

Home Forums Support Frackin' relative URLs

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1220273
    Tris

    I’m trying add local fonts to my customer’s site. Tom’s tutorial is great…but I don’t want to use explicit URLs, I want to use relative ones for my CSS.

    This is a sample of my CSS:

    /* Webfont: Edingu-Regular */@font-face {
    font-family: ‘Edingu’;
    src: url(‘edigu/Edingu-Regular.eot’); /* IE9 Compat Modes */
    src: url(‘edigu/Edingu-Regular.eot?#iefix’) format(’embedded-opentype’), /* IE6-IE8 */
    url(‘edigu/Edingu-Regular.woff’) format(‘woff’), /* Modern Browsers */
    url(‘edigu/Edingu-Regular.ttf’) format(‘truetype’), /* Safari, Android, iOS */
    url(‘edigu/Edingu-Regular.svg#Edingu-Regular’) format(‘svg’); /* Legacy iOS */
    font-style: normal;
    font-weight: normal;
    text-rendering: optimizeLegibility;
    }

    The font is showing up in the Typography section (yay for cut and paste PHP) just fine, but the font isn’t actually showing.

    I’m using a child theme called generatepress_child … in the usual place the the fonts are all in edigu dir. So what’s the right relative URL to use here? ./edigu ? /wp-content/themes/generatepress_child/edigu/ ?

    It’s the one thing about CSS I always forget.

    Thanks … Tris

    #1220338
    Tris

    Typo. Stupid typo.

    #1220562
    David
    Staff
    Customer Support

    Hi there,

    so in your child theme folder you:

    1. place your styles.css that includes your @font-face.
    2. Create a folder named fonts

    Then the relative path would be /fonts/file.ttf for example.

    #1221001
    Tris

    Thanks David. I figured out what I did wrong. In the code I have the dir as edigu when in fact the dir is edingu (stupid n) … so my original ./edingu… would have worked if I had actually typed the line right.

    I’m blaming my wrist brace I have to wear right now. Yeah, it’s the wrist brace.

    #1221018
    David
    Staff
    Customer Support

    Haha 🙂
    Glad to hear you got it resolved.

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