### [wordpress怎么设置中文字体](https://www.prosaas.cn/article/4779) **Published:** 2019-07-15T01:39:34 **Author:** 5201314 **Excerpt:** 在WordPress中设置中文字体的方法如下:将如下代码加到当前主题的 functions.php 模板文件中… ![](//zhiqipro.oss-cn-beijing.aliyuncs.com/2023/12/20231212123237683.jpg) 在WordPress中设置中文字体的方法如下: 将如下代码加到当前主题的 functions.php 模板文件中: function custum\_fontfamily($initArray){ $initArray\['font\_formats'\] = "微软雅黑='微软雅黑';宋体='宋体';黑体='黑体';仿宋='仿宋';楷体='楷体';隶书='隶书';幼圆='幼圆';"; return $initArray; } add\_filter('tiny\_mce\_before\_init', 'custum\_fontfamily'); WordPress默认TinyMCE编辑器并没有选择字体功能,所以还需要把下面代码也一同加到 functions.php 模板文件中: function enable\_more\_buttons($buttons) { $buttons\[\] = 'styleselect'; $buttons\[\] = 'fontselect'; return $buttons; } add\_filter("mce\_buttons", "enable\_more\_buttons"); 更多wordpress相关技术文章,请访问wordpress教程栏目进行学习! 以上就是wordpress怎么设置中文字体的详细内容,更多请关注知企PROSAAS其它相关文章! **Categories:** WordPress ---