找不到WordPress自定义字体

我从头开始创建了一个自定义的WordPress主题

我正在尝试使用自定义字体

我做了什么

将字体上传到wp-content / themes / mythemefolder / fonts / fontfolder

在主题默认style.css中

@font-face {
        font-family: "fontname";
        src: url('fonts/fontfolder/fontname.otf');
}
*{font-family: "fontname";}

当我visti页面文字不是所需字体时

我检查控制台显示错误:

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 

控制台中字体的路径正确, 但字体仍然不起作用

我在犯什么错误

在此先感谢你的帮助


#1


你需要更改路径中包含的字体文件的权限。

你可以通过FTP或命令行工具执行此操作。

通过FTP:通过右键单击更改文件许可权, 文件必须为644, 文件夹为777。

通过命令行,

find your_folder_name -type d -exec chmod 755 {} \;
find your_folder_name -type f -exec chmod 644 {} \;

来源:

https://www.srcmini02.com/66698.html

微信公众号
手机浏览(小程序)
0
分享到:
没有账号? 忘记密码?