dsw8292301 2013-08-05 02:03
浏览 176
已采纳

在WordPress中指定TinyMCE编辑器字体颜色?

I'm using TinyMCE in WordPress, and when you type in the editor, the color of the text is #333333 or rgb(51, 51, 51). What's odd is that the default color in the "Select text color" button is #eeeeee, yet when you type on page load, it's still #333333. I'm using this function in functions.php to set the colors:

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');

How do I change both the default font color and font family of text entered into the editor?

  • 写回答

1条回答 默认 最新

  • dpq755012465 2013-08-05 07:04
    关注

    Create my-editor-style.css stylesheet in your theme root folder and put your styles there:

    body#tinymce.wp-editor { 
        font-family: Arial, Helvetica, sans-serif; 
    }
    
    body#tinymce.wp-editor a {
        color: #4CA6CF;
    }
    

    And finally load this file by adding following hook into your functions.php file:

    add_action( 'init', 'wpse8170_add_editor_styles' );
    function wpse8170_add_editor_styles() {
        add_editor_style( 'my-editor-style.css' );
    }
    

    Read more about editor styles in codex.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 路易威登官网 里边的参数逆向
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决
  • ¥15 processing提取音乐节奏