• hi there,

    the webfont is not working in my siter,

    here is the code in CSS,

    @font-face {
    font-family: ‘hanwangyenlightregular’;
    src: url(‘/wp-content/themes/sydney/fonts/wt006-webfont.ttf’);
    src: url(‘/wp-content/themes/sydney/fonts/wt006-webfont.eot’);
    src: url(‘/wp-content/themes/sydney/fonts/wt006-webfont.eot?#iefix’) format(’embedded-opentype’),
    url(‘/wp-content/themes/sydney/fonts/wt006-webfont.woff2’) format(‘woff2’),
    url(‘/wp-content/themes/sydney/fonts/wt006-webfont.woff’) format(‘woff’),
    url(‘/wp-content/themes/sydney/fonts/wt006-webfont.ttf’) format(‘truetype’),
    url(‘/wp-content/themes/sydney/fonts/wt006-webfont.svg#hanwangyenlightregular’) format(‘svg’);
    font-weight: normal;
    font-style: normal;

    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6{ font-family: ‘hanwangyenlightregular’; }

    NOTE : I know there is something wrong with the code coz most words are red in color. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    In your CSS, urls are relative to the stylesheet directory, so change your src statements to ‘/fonts/etc’

    Thread Starter kppyeung

    (@kppyeung)

    hi there,

    forgot to mention that I am using child theme,

    should I add the code into the style.css of the child theme, or

    add directly into the custom CSS?

    thanks!

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    If you’re using a child theme, then use your child theme’s style.css. Why would you need a custom CSS if you have a child theme?

    Thread Starter kppyeung

    (@kppyeung)

    coz I don’t know much about wp!

    with your help, now I know something about child theme’s style.css

    ??

    thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘webfont not loading’ is closed to new replies.