WordPress安装自定义字体

0x00.下载所需字体 ,确保FTP服务器可用


0x01.将字体文件上传至FTP服务器


0x02.在主题目录下新建fonts文件夹

mkdir fonts

0x03.复制字体文件至fonts文件夹

cp xxx.ttf /www/wwwroot/async.website/wp-content/themes/xxx/fonts

0x04.修改fonts文件夹权限

chmod -R 777 fonts

0x05.在主题的style.css中添加@font-face

@font-face {
  font-family: xxx; 
  src: url(https://xxxx.xxx/wp-content/themes/xxx/fonts/xxx.ttf); /*修改url为自己的字体路径*/
  font-weight: normal; 
}

0x06.在所需地方引用,如需要修改style.css中site-description的字体

.site-description {
  display: inline-block;
  margin-top: 15px;
  margin-bottom: 0;
  font-size: 50px;
  font-family:Debby;
  line-height: 1.1;
}

 

 

 

0 0 投票数
文章评分
订阅评论
提醒
guest
0 评论
内联反馈
查看所有评论
0
希望看到您的想法,请您发表评论x