Wordpress 3.0:Style WordPress editor using CSS
April 27, 2010 by admin · Leave a Comment
WordPress features a WYSIWYG editor, which allow you to see text in bold, italic, and so on. But some people want more, such as being able to visualize their blog post in the blog font and colors.
This new feature allows you to create a css file (named editor-style.css in the example below) and link it to the editor for a better WYSIWYG rendering. Simply paste this code snippet to your functions.php file.
<pre>add_filter('mce_css', 'my_editor_style');
function my_editor_style($url) {
if ( !empty($url) )
$url .= ',';
// Change the path here if using sub-directory
$url .= trailingslashit( get_stylesheet_directory_uri() ) . 'editor-style.css';
return $url;
}</pre>
Related posts: