导言:
WordPress内置的TinyMCE编辑软件,针对一般的公众号编辑已充分了,但也是有朋友期待它作用大量,因此问世了各种各样编辑软件提高软件,实际上无需软件还可以为默认设置编辑软件提升各种各样作用,下边的方式 可以为编辑软件提升挑选手写字体作用。
将如下所示编码加到当今主题风格的 functions.php 模版文档中:
- function custum_fontfamily($initArray){
- $initArray[‘font_formats’] = “微软雅黑=’微软雅黑’;宋体字=’宋体’;黑体字=’黑体’;仿宋=’仿宋’;楷体=’楷体’;篆书=’隶书’;幼圆=’幼圆’;”;
- return $initArray;
- }
- add_filter(‘tiny_mce_before_init’, ‘custum_fontfamily’);
WordPress默认设置编辑软件沒有挑选字体样式作用,把下边编码也一同加到 functions.php 模版文档中::
- function enable_more_buttons($buttons) {
- $buttons[] = ‘styleselect’;
- $buttons[] = ‘fontselect’;
- return $buttons;
- }
- add_filter(“mce_buttons”, “enable_more_buttons”);
适用WordPress 4.0,以前版本号未试。