wordpress怎么设置中文字体

wordpress怎么设置中文字体

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教程栏目进行学习!

© 版权声明
THE END
喜欢就支持一下吧
点赞5 分享