Captions Not Working Right in WordPress 2.7

Did your captions suddenly get a mind of their own when you upgraded to 2.7?

The existing images with captions will be fine. However, with the advent of 2.7 captioned images are now wrapped in a “div” tag. There are two lines of code you will need to add to your styles.css for images to once again behave themselves.

It seems to depend on a couple of things I haven’t isolated yet.   I don’t know if it is the browser you use to create the post, the theme you are using, or a change in how the WP Editor writes the code.

What I discovered when trying to place a caption image to the left in a post it was missing code to handle this since it was now wrapped in a div tag.   I added these lines to the CSS captioning section and all began to work again.

.alignleft {
float: left;
}

.alignright {
float: right;
}

Place these right under:

/* Captions */
.aligncenter,
div.aligncenter {
display: block;
margin-left: auto;
margin-right: auto;
}

With this little addition they should behave themselves again.

This probably doesn’t have an impact on many bloggers.   I don’t see very many using the Caption feature.   It also seems to be rare to see an image in a post which isn’t centered.

What does this say about images and captions

If you want your blog to stand out from others   put images left and right with text along side and use captions.

Your blog won’t be the same as every other blog you read.   Yes, I know there is no image in this post.

Comments

  1. Testing anti spam plug-in

  2. I’ve wanted to use captions for sometime but they never seemed to work right. I didn’t even have the */captions/* section in my stylesheet.
    Thanks
    Rob

    Rob Saxe ´s last blog post..Pulte Homes Sales Event This Weekend!