我们在编辑Wordpress文章的时候,传统的编辑器只有字体颜色的选择,没有字体样式和字体大小选择的功能,是因为wordpress没有这个功能,我们只需要在主题的functions.php中添加以下代码即可:

function MBT_add_editor_buttons($buttons) {
 $buttons[] = 'fontselect';
 $buttons[] = 'fontsizeselect';
 $buttons[] = 'cleanup';
 $buttons[] = 'styleselect';
 $buttons[] = 'del';
 $buttons[] = 'sub';
 $buttons[] = 'sup';
 $buttons[] = 'copy';
 $buttons[] = 'paste';
 $buttons[] = 'cut';
 $buttons[] = 'image';
 $buttons[] = 'anchor';
 $buttons[] = 'backcolor';
 $buttons[] = 'wp_page';
 $buttons[] = 'charmap';
 return $buttons;
}
add_filter("mce_buttons_2", "MBT_add_editor_buttons");