Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a Wordpress site in which the background color is black and the text is white. The site is fine, but it's a pain trying to edit content in the visual editor as the background is white (same color as the text). I end up having to tell users to use the HTML view or write up the content in black color text and then at the end just select all the text and flip it to white (in which case many of them freak out and think their text is now deleted!)

How do I change the background color of the editor to black (or any other color) so that the content can be readable if the text color is to be white?

share|improve this question
    
+1 for the good Question & +1+ for the great Answers it got! –  brasofilo Jul 14 '12 at 16:33
add comment

2 Answers

up vote 2 down vote accepted

similar to the answer by GavinR, using the wordpress add_editor_style() function; (as implemented in Twenty Ten and Twenty Eleven)

in functions.php of your theme, add:

add_editor_style();

then create an editor-style.css in your theme folder:

.mceContentBody.wp-editor {     
  background-color: #000;
  color: #fff; 
} 
share|improve this answer
add comment

First, add a CSS file in your theme directory (I'm calling it tiny.css). Then add the following to your theme's functions.php:

// Add custom styles to TinyMCE editor
if ( ! function_exists('tdav_css') ) {
    function tdav_css($wp) {
        $wp .= ',' . get_bloginfo('stylesheet_directory') . '/tiny.css';
        return $wp;
    }
}
add_filter( 'mce_css', 'tdav_css' );

Finally, add this CSS to tiny.css

.mceContentBody.wp-editor {
    background-color:#000000;
}

... replacing #000000 with the HTML color code of what color you'd like it to be.

share|improve this answer
    
First rule of WP hacking - never edit core files. First person to post the correct way to restyle the editor gets my vote.. –  t31os Aug 9 '11 at 0:14
    
Great point! I have modified this so that it does not modify core WordPress files. –  GavinR Aug 9 '11 at 0:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.