首先,请记住,html用于添加含义和css外观。
如果您出于语义原因想更改文本大小,如“此文本是一个小节标题”或“此句子非常重要”,我建议您不要使用<span style="font-size: xx">. 对于那些案例来说,这是一种更好的做法<strong>, <em> 或者一个合适的标题标签,然后更改主题的css,根据您的喜好自定义其外观。
如果不是出于语义,而是出于表象的原因,你可以接受<span style="font-size: xx">.
为了简化操作,您可以使用以下代码向文本编辑器添加一个新按钮,该按钮将允许您选择字体大小,而无需每次对其进行硬编码。

只需将代码复制到新文件,另存为
show-font-size-button-in-editor.php 并将其作为插件安装和激活。或者,您可以复制
function 和
add_filter 到您的主题
functions.php 文件
<?php
    /*
        Plugin Name: Show font size button in editor
        Description: Adds a font size selector to the TinyMCE first tools row
        Version: 0.1
        Author: WPSE
        Author URI: http://wordpress.stackexchange.com/questions/225895/how-can-i-change-the-size-of-the-text-in-word-press
    */
    defined( \'ABSPATH\' ) or die( \'Method not allowed.\' );
    function wpse225895_show_font_size_button_in_editor( $buttons ) {
        array_unshift ( $buttons, \'fontsizeselect\' );
        return $buttons;
    }
    add_filter( \'mce_buttons\', \'wpse225895_show_font_size_button_in_editor\', 10, 1 );
?>