Keith Curreri

Images won’t align in WordPress editor

Rarely you may be working with a WordPress theme that won’t allow you to align images via the WordPress editor. If the WordPress theme you are working with does not let you position images so that they float to the left or right there may be a lack of styling in the CSS. Luckily, if this is your problem there is an easy fix.

Try opening your CSS stylesheet (using an FTP client) in the WordPress theme folder and add the following styling code:

img.centered {
 display: block;
 margin-left: auto;
 margin-right: auto;
}
.aligncenter{
 display: block;
 margin-left: auto;
 margin-right: auto;
}
 
img.alignright {
 padding: 4px;
 margin: 0 0 2px 7px;
 display: inline;
}
 
img.alignleft {
 padding: 4px;
 margin: 0 7px 2px 0;
 display: inline;
}
 
.alignright {
 float: right;
}
 
.alignleft {
 float: left;
}

Hopefully now when you try to align images they should work just fine!

Share

Related posts:

  1. Adding a Class Using Custom Fields in WordPress

3 Responses to “Images won’t align in WordPress editor”

  1. That might work. Or you could just share this with them. lol

    [Reply]

    Keith's reply on

    Mitch,

    Nice tip! I can see that you have come across image alignment issues in the past as well.

    [Reply]

    Mitch's reply on

    Oh yeah, and it irritated me enough to figure out what to do.

    [Reply]

Leave a Reply