【发布时间】:2017-10-10 04:14:36
【问题描述】:
我从头开始创建了一个自定义 wordpress 主题
我正在尝试使用自定义字体
我做了什么
将字体上传到wp-content/themes/mythemefolder/fonts/fontfolder
在主题默认 style.css
@font-face {
font-family: "fontname";
src: url('fonts/fontfolder/fontname.otf');
}
*{font-family: "fontname";}
当我访问页面文本不是所需的字体时
我检查控制台显示错误:
Failed to load resource: the server responded with a status of 404 (Not Found) http://domainname.com/wp-content/themes/mythemefolder/fonts/fontfolder/fontname.otf
控制台中的字体路径正确,但字体仍然无法正常工作
我犯了什么错误
提前感谢您的帮助
【问题讨论】:
-
可以给个网站链接看看吗?
-
@AhmedGinani 是的,当然 - digiw3lab.com/wp
-
上传所有字体扩展 otf,ttf,woff,eot ..您目前只使用 otf 格式..
标签: wordpress css fonts wordpress-theming font-family