如何改变WordPress编辑器字体

如果您是使用WordPress可视化编辑器来撰写文章,您可能想要改变它默认的字体以适应自己的需要,这里提供一个诀窍,简单得很。将以下这段代码放到当前主题的functions.php文件中即可:

function devpress_fix_html_editor_font() { ?>
<style type="text/css">#editorcontainer #content, #wp_mce_fullscreen { font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; }</style>
<?php }

add_action( 'admin_head-post.php', 'devpress_fix_html_editor_font' );
add_action( 'admin_head-post-new.php', 'devpress_fix_html_editor_font' );

这段函数中指定的字体是:Georgia, 您可以改成自己喜欢的字体。

代码来源:wprecipes

你可能还喜欢:

分享这篇日志:

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>