问题
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