如果您是使用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