Wordpress Custom font not found

2019-09-21 10:53发布

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条回答
萌系小妹纸
2楼-- · 2019-09-21 11:01

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 {} \;
查看更多
登录 后发表回答