• Hello again!

    I’m integrating @font-face with my theme and it uses a CSS like:

    @font-face {
    	font-family: "fontname";
    	src: url(fontname.ttf) format("truetype");
    }
    
    h1 { font-family: "fontname", serif; }

    It works well when I upload the font on my server but how can I call it from the theme file?

    I tried /wp-content/themes/mytheme/fontname.ttf

    but that doesn’t work.. please help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • from one of your theme’s php files?

    I don’t know anything about working with fonts….so I can’t answer with any knowledge…other than actually linking to stuff

    <?php bloginfo('template_url'); ?>/font/fontname.ttf gets you the link within your theme

    or from your css?
    that would just be url('font/fontname.ttf')

    This is assuming the font is in your theme in a folder called font

    Thread Starter nemci7v

    (@nemci7v)

    Thanks! putting them in a fonts folder worked ?? not sure why tho.. it didn’t pick them from just the theme folder.

    meh…as long as its workin eh!

    Thread Starter nemci7v

    (@nemci7v)

    lol yeah. I think it was like that with half the stuff I achieved.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WordPress CSS url reference’ is closed to new replies.