WordPress编辑器代码(自定义中文字体)
WordPress字体编辑及增加中文字体等功能 functions.php中写入以下代码: […]
WordPress字体编辑及增加中文字体等功能
functions.php中写入以下代码:
function custum_fontfamily($initArray){ $initArray['font_formats'] = "Times New Roman='Times New Roman';Arial Black='Arial Black';Cambria='Cambria';Microsoft JhengHei='Microsoft JhengHei';华文行楷='华文行楷';微软雅黑='微软雅黑';宋体='宋体';黑体='黑体';仿宋='仿宋';楷体='楷体';隶书='隶书';幼圆='幼圆';思源黑体 CN Bold='思源黑体 CN Bold';叶根友毛笔行书='叶根友毛笔行书';"; return $initArray; } add_filter('tiny_mce_before_init', 'custum_fontfamily'); function add_editor_buttons($buttons) { $buttons[] = 'justfyfull'; $buttons[] = 'styleselect'; $buttons[] = 'fontselect'; $buttons[] = 'fontsizeselect'; $buttons[] = 'backcolor'; $buttons[] = 'underline'; $buttons[] = 'strikethrough'; $buttons[] = 'outdent'; $buttons[] = 'indent'; $buttons[] = 'removeformat'; $buttons[] = 'hr'; $buttons[] = 'sub'; $buttons[] = 'sup'; $buttons[] = 'cut'; $buttons[] = 'copy'; $buttons[] = 'paste'; $buttons[] = 'undo'; $buttons[] = 'del'; $buttons[] = 'image'; $buttons[] = 'cleanup'; $buttons[] = 'wp_page'; $buttons[] = 'newdocument'; $buttons[] = 'anchor'; $buttons[] = 'charmap'; $buttons[] = 'spellchecker'; return $buttons; } add_filter("mce_buttons_3", "add_editor_buttons");