最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Issue with Webfontfont-face in child theme

programmeradmin2浏览0评论

I've uploaded a free webfont to my child theme. It's placed in a folder labelled 'fonts'. I can't for the life of me get it to link correctly and work.

This is the code I'm using in the child theme stylesheet

@font-face {
  font-family: 'GlacialIndifference';
  src: url('.eot'); /* IE9 Compat Modes */
  src: url('.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('.woff2') format('woff2'), /* Super Modern Browsers */
       url('http:/MYWEBSITEURL/wp-content/themes/atmosphere-child/fonts/GlacialIndifference-Regular.woff') format('woff'), /* Pretty Modern Browsers */
       url('.ttf')  format('truetype'), /* Safari, Android, iOS */
       font-weight: 400;
       font-style: normal;
}

@font-face {
  font-family: 'GlacialIndifference';
  src: url('.eot'); /* IE9 Compat Modes */
  src: url('.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('.woff2') format('woff2'), /* Super Modern Browsers */
       url('.woff') format('woff'), /* Pretty Modern Browsers */
       url('.ttf')  format('truetype'), /* Safari, Android, iOS */
       font-weight: 700;
       font-style: normal;
}

I've also tried the following:

@font-face {
  font-family: 'GlacialIndifference';
  src: url('.../fonts/GlacialIndifference-Regular.eot'); /* IE9 Compat Modes */
  src: url('.../fonts/GlacialIndifference-Regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('.../fonts/GlacialIndifference-Regular.woff2') format('woff2'), /* Super Modern Browsers */
       url('.../fonts/GlacialIndifference-Regular.woff') format('woff'), /* Pretty Modern Browsers */
       url('.../fonts/GlacialIndifference-Regular.ttf')  format('truetype'), /* Safari, Android, iOS */
       font-weight: 400;
       font-style: normal;
}

@font-face {
  font-family: 'GlacialIndifference';
  src: url('.../fonts/GlacialIndifference-Bold.eot'); /* IE9 Compat Modes */
  src: url('.../fonts/GlacialIndifference-Bold.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('.../fonts/GlacialIndifference-Bold.woff2') format('woff2'), /* Super Modern Browsers */
       url('.../fonts/GlacialIndifference-Bold.woff') format('woff'), /* Pretty Modern Browsers */
       url('.../fonts/GlacialIndifference-Bold.ttf')  format('truetype'), /* Safari, Android, iOS */
       font-weight: 700;
       font-style: normal;
}

I feel like both of those snippets above should work so I'm at a loss as to what I should try next. I copied the font path directly from cPanel.

Help would be appreciated!

Cheers, Rob

发布评论

评论列表(0)

  1. 暂无评论