WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The textarea in which posts are written and edited doesn't handle image layout very well.

edit post textarea with photos

Inserted images seem to be aligned with the left edge of the textarea, or the right edge of the previous image. This is often hard to work with, and users have to understand that this isn't the way they will show up once published.

I'm after a better-looking, and more usable layout.

I'd like to be able to ALWAYS have non-floated images appear left justified and stacked one on top of the other.

Is this solved by modifying the admin css, or is the formatting of images in the textarea accomplished another way?

share|improve this question
up vote 1 down vote accepted

Add this to your theme's functions.php file:


By default that function will load a file called editor-style.css which is located in the root directory of your theme. The functions accepts a filename or an array of filenames as parameter. Reference in the Codex: http://codex.wordpress.org/Function_Reference/add_editor_style

If you want (or need to have) more control over the custom CSS file name and location you can use this function instead:

function custom_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;
add_filter('mce_css', 'custom_editor_style');
share|improve this answer
With that CSS file you can control all the styles for the visual editor. It's good for providing coherent styles for the backend editor. They should be a subset of your main stylesheet rules. – iv.draganov Sep 1 '10 at 23:04
@iv.draganov: Nice! – MikeSchinkel Sep 1 '10 at 23:11
thanks for the lead, iv...While including add_theme_support() didn't work, I was able to find what I was looking for once I knew where to look thanks to your answer. The function that actually worked is add_editor_style();. If you agree, edit your answer and I'll mark it as the one. If you don't agree, care to elaborate why? – kevtrout Sep 2 '10 at 0:14
Yes, you are right - add_editor_style(); should be used instead. I've updated my answer. Reference in the Codex: codex.wordpress.org/Function_Reference/… – iv.draganov Sep 3 '10 at 9:41

Your Answer


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.