WordPress 2.6 Changes How WordPress Handles Images
Category: Themes and Tricks
- CSS We Are The Buzz




(5 out of 5) - Throw




(5 out of 5) - qmula




(5 out of 5) - Heartworker




(5 out of 5) - Decently Exposed




(5 out of 5) - DePo Masthead




(3 out of 5) - Sinklar




(3 out of 5) - Simple WordPress Theme - SimpleWP




(3 out of 5) - Arman Adhitama




(3 out of 5) - Michelle Dinan




(3 out of 5)
If you’ve already upgraded to WordPress 2.6, you might have noticed that WordPress handles images a little differently than the WordPress 2.5 branch and below. The main change is that you can now use the alt field to add a caption, which will wrap a sort of caption below the image.
The problem I’ve had with this new setup is that it can cause some problems when trying to float your images due to the new class=”alignleft”, class=”alignright” or class=”aligncentered” elements. The image will still move, but I’ve found the text won’t wrap properly around the image.
Thanks to a recent post from Sadish over at WP Lover, it looks like this problem can easily be fixed by by adding some code anywhere into your CSS stylesheet:
img.alignleft, div.alignleft
{
float:left;
margin:0 0.5em 0.5em 0;
}
img.alignright, div.alignright
{
float:right;
margin:0 0 0.5em 0.5em;
}
img.aligncentered, div.aligncentered
{
text-align:center;
margin:0 auto;
}
This way the images should float and the text should wrap properly. Thanks for posting the easy fix Sadish!
—
Related Articles at Hack WordPress:
- How To: Prevent Google From Indexing Your Images
- Copyrighted Images - and the Ideal Solutions
- The Wordpress i3 Theme
- Increase Traffic by Choosing the Right Images for your Post
- When Has Stealing Blog Content Gone To Far?
- Popular Posts - May 2008
You are reading WordPress 2.6 Changes How WordPress Handles Images. This post is the property of Hack WordPress © 2008.
Enjoy writing about WordPress? Get your blog more exposure by joining the Hack WordPress writing team!
Digg This! | Stumble This! | Add to Del.icio.us! | Google Bookmark It!
