找不到Wordpress自定义字体 [英] Wordpress Custom font not found

查看:136
本文介绍了找不到Wordpress自定义字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从头开始创建了一个自定义的wordpress主题
我正在尝试使用自定义字体
我做了什么
将字体上传到wp-content/themes/mythemefolder/fonts/fontfolder
在主题默认样式中.css

I created a custom wordpress theme from scratch
I am trying to use custom font
what I done
upload font to wp-content/themes/mythemefolder/fonts/fontfolder
in theme default style.css

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

当我的页面文字不是所需字体时的字体
我检查控制台显示错误:

when I visti page text are not in desired font
I check console show error :

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 


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


path of font in console is correct but still font not working

我犯什么错误

预先感谢您的帮助

推荐答案

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

You need to change the permission of the font files included on the path.

您可以通过FTP或命令行工具来做到这一点.

You can do that via FTP or command line tools.

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

Via FTP : Change the file permission via right click , it must be 644 for file and 777 for folder.

通过命令行

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

这篇关于找不到Wordpress自定义字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆