调整wordpress古腾堡编辑器的字体样式

不知道是从wordpress的哪个版本更新后,古腾堡编辑器(Gutenberg Editor)的字体就变了,变得更小了,而且行间距也很小,看着不舒服,写作的时候更不舒服,对文字创作带来了一丁点阻力。

本着但凡对创作有阻碍的事情都必须铲除干净的原则,我使用了下面的代码,当然,这也大大得力于AI的出现。

把下面的的代码在类似Code Snippets这样的插件中使用即可(或者你喜欢的方式),在.editor-styles-wrapper那里根据自己的喜好,把字体大小,字间距,字体进行调整就可以了

function custom_gutenberg_editor_inline_style() {
    echo '<style>
        .editor-styles-wrapper {
            font-size: 19px !important;
            line-height: 1.7 !important;
            font-family: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", "微软雅黑", sans-serif !important;
        }
        .editor-styles-wrapper p {
            margin-bottom: 1.2em;
        }
    </style>';
}
add_action('admin_head', 'custom_gutenberg_editor_inline_style');

Contact Us Today, Get Reply Tomorrow

Your information will be kept strictly confidential.

Ben Fang, the author behind benf138.sg-host.com.

I am Ben Fang, the CEO of handyrocky.com, me and my team would be happy to meet you and learn all about your business, requirements and expectations.