eclipsis
eclipsis

Reputation: 1550

Specify TinyMCE editor font color in WordPress?

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?

Upvotes: 0

Views: 2081

Answers (1)

Eugene Manuilov
Eugene Manuilov

Reputation: 4361

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.

Upvotes: 1

Related Questions