我在WordPress中使用TinyMCE,当你在编辑器中输入时,文本的颜色是#333333或rgb(51,51,51) . 奇怪的是,“选择文本颜色”按钮中的默认颜色是#eeeeee,但是当您在页面加载时键入时,它仍然是#333333 . 我在functions.php中使用此函数来设置颜色:
function change_mce_options( $init ) {
$init['theme_advanced_default_foreground_color'] = '#eeeeee';
$init['theme_advanced_text_colors'] = 'eeeeee,ff4343,8383cc';
return $init; }
add_filter('tiny_mce_before_init', 'change_mce_options');
如何更改输入编辑器的文本的默认字体颜色和字体系列?
1 回答
在主题根文件夹中创建
my-editor-style.css
样式表并将样式放在那里:最后通过在
functions.php
文件中添加以下钩子来加载此文件:在codex中阅读有关editor styles的更多信息 .