Wordpress Custom font not found

坚强是说给别人听的谎言 提交于 2019-12-14 03:27:09

问题


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

what mistake I am making

thanks in advance for help


回答1:


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

You can do that via FTP or command line tools.

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

Via command line,

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


来源:https://stackoverflow.com/questions/43910680/wordpress-custom-font-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!