Fixing Image Alignment Problems and Errors in WordPress 2.6
After discussing in brief what to expect in WordPress 2.6 in the article “WordPress 2.6 Stable Release: Will you Upgrade?” and some of the immediate problems encountered just after upgrading to WordPress 2.6 in relation to image alignment, here comes a possible fix to this error in WordPress programming. Yes, the developers of WordPress should admit that it is a programming error. I have tried fixing the image alignment problems myself but to no avail. I found out that the fix is in the codex subdomain of wordPress.org after almost knocking myself out looking into individual Php files included in the installation package of WordPress 2.6 (note: I upgraded my WordPress installation in one of my sites using the manual method).
To cut the long story short, WordPress 2.6 is not fully compatible with some existing themes. In my site The Reporter, the theme being used is Hey Lucy. I found out that compatibility with themes is the culprit why I was not able to align images to the center of page or post content (for details, read the article cited above).
At first (just after installation) I could align the images to the center and so I thought it the Stable Release of WordPress 2.6 was doing great. I have encountered this error in the WordPress 2.6 Beta 3 Release and I was way too confident the upgrade to the Stable Release was great until I tested it further by posting an article about the Box-Office Earnings of The Dark Knight. Initially, the article contained individual photos and TinyMCE did not indicate any problem with the alignments (tried align-left, align-right and align-center). However, the preview of the post indicated a problem with alignment of images to the center.
Now, to enable WordPress 2.6 users to align images properly, you have to include the following codes in your CSS stylesheets located under Theme Editor (style.css):
.aligncenter,
div.aligncenter {
display: block;
margin-left: auto;
margin-right: auto;
}.alignleft {
float: left;
}.alignright {
float: right;
}.wp-caption {
border: 1px solid #ddd;
text-align: center;
background-color: #f3f3f3;
padding-top: 4px;
margin: 10px;
/* optional rounded corners for browsers that support it */
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}.wp-caption img {
margin: 0;
padding: 0;
border: 0 none;
}.wp-caption p.wp-caption-text {
font-size: 11px;
line-height: 17px;
padding: 0 4px 5px;
margin: 0;
}
Putting these codes in my style.css file solved my problem and so far, I’m not having problems with image alignment in my WordPress 2.6 site. You can try this fix and see if it works with your theme.
If you want to get updates on Nursing Researches, Nursing Board Exam Results, Nursing Articles, Nursing Education, Health and Health tips, and other informative articles in this site, please subscribe to my Free RSS feed. Thank you very much!
Tags: Technology, WordPress, WordPress 2.6 Upgrade, WordPress Upgrade


Fren out of 4wp hosted blog ko isa palang ang successful sa upgrade at ang bilis pa dito sa blog nato kaso yung SezWho ayaw ata tanggapan. Ano tingin mo sa SezWho fren? Yung beta2x nayan fren wala ako alam sa kaibahan nyan wahehehe.
Joy’s last blog post..Ticket to the Party
[Reply]
jessie reply on July 23rd, 2008:
Fren,
WordPress 2.6 is incompatible with some plugins and scripts. It’s not even compatible with my existing theme kaya nag-edit ako.
jessie’s last blog post..Denise Richards in Hawaii Shooting “It’s Complicated”, Deals With Paparazzis
[Reply]
joy reply on July 23rd, 2008:
Ah that’s why only my http://kikay-site.net response in all. Sezwho pay release sila for 2.6 kaso dipa rin nagwork. But at least social bookmarking plug in accepted in 2.6. Fren tanong..Panu maglagay ng ganto reply to message then may anti-spam? Ask nalang ako huh kasi kakapagod mangalkal papanu eh wahehehe.
joy’s last blog post..Kids Fashion
[Reply]
jessie reply on July 23rd, 2008:
Joy,
Download the plugin WORDPRESS THREAD COMMENT and ANTI-SPAM MATH plugins from wordpress.org…. andun kasi yung mga tested na plugins.
jessie’s last blog post..Browse the Internet Using Your Mobile Phone and Opera Mini
[Reply]
Joy reply on July 23rd, 2008:
wow salamat fren, kanina pa ako naghahanap plug in, nahihilo na ako kung alin..compatible ba fren kahit ano version? ay segi tingnan ko nalang dun.
Joy’s last blog post..Remember the Walk
[Reply]
Joy reply on July 23rd, 2008:
may comment ako dito kanina pareng Jess parang nawala may tinatanong ako bout reply message ang capcha panu ilagay or i mean edit?
Joy’s last blog post..Remember the Walk
[Reply]
jessie reply on July 23rd, 2008:
Joy,
Ok na yung comment link mo. Sometimes, WordPress comments take a while to appear.
jessie’s last blog post..Denise Richards in Hawaii Shooting “It’s Complicated”, Deals With Paparazzis
[Reply]
Thanks for the info. Yung ginawa ko ring theme walang .wp-caption, malagyan nga….
Amor’s last blog post..Made in Japan
[Reply]
Amor,
Ok fren. Try to edit your stylesheet in WordPress 2.6. In all honesty, I like WordPress 2.5.1 more than 2.6… The new version has so many errors in encoding and worse, I can’t properly embed videos.
jessie’s last blog post..Videoconferencing is Becoming a Trend
[Reply]
Great… Worked fine!
Código PT’s last blog post..Ferramenta de desbloqueio do iPhone dispon?’vel
[Reply]
jessie reply on July 23rd, 2008:
Great! I’m happy to know that the workaround for image alingment issues in WordPress worked just fine in your theme.
jessie’s last blog post..Browse the Internet Using Your Mobile Phone and Opera Mini
[Reply]
Thank you! After trying soo much fixes, this one was the only one that worked for me.
[Reply]
You are a GODSEND. I was racking my brain trying to figure out why my images wouldn’t align and didn’t even think it could be my custom template. Thank you thank you!!! This worked PERFECTLY.
Fashion Paramedic’s last blog post..Oh, the Rocky HORROR!
[Reply]
jessie reply on July 26th, 2008:
Fashion,
No problem. Thanks for dropping by.
jessie’s last blog post..Denise Richards in Hawaii Shooting “It’s Complicated”, Deals With Paparazzis
[Reply]
Fren, I installed 2.6 in my personal site na, and I didn’t encounter this problem. Maybe because I usually enter the image class manually after uploading. Kapag upload ko kasi sa image, kini-click ko yung noalignment. And sa themes naman ay chini-check ko kung ano ang style ng images na nilagay ng author. Like sa first theme ko dati nakalagay img.centered, then sa bagong theme ko img.center lang. Kaya kailangan ko i-changed sa img.centered ang bagong theme dahil pag hindi ay magsasayaw ang mga dati kong na-post na pics, hehee. But I might try the caption elements.
Marlene’s last blog post..Can Computer Games Affect Studies?
[Reply]
jessie reply on July 26th, 2008:
Fren,
That’s good news. I admit there are themes that really do not have caption and image handling classes so the workaround (checking for the divs and classes) is a good habit before using a theme in WordPress 2.6. unfortunately, some of my themes do not have these in their CSS files so I had to edit the stylesheets manually.
jessie’s last blog post..Denise Richards in Hawaii Shooting “It’s Complicated”, Deals With Paparazzis
[Reply]
Brilliant! Thanks for this. I was starting to rip my hair out with this new 2.6 and why the #*&%# aren’t my images aligning!
TurntheScrew’s last blog post..Schapple, Bahoogle, Narcorati, and more!
[Reply]
jessie reply on July 30th, 2008:
TurntheScrew,
It’s always a pleasure to have shared something. I know how frustrating it is to deal with WordPress 2.6 because in 2.5 and 2.5.1, these problems did not exist.
jessie’s last blog post..PS3 Update 2.42 Ready for Download But Offers No Significant Improvement to the Old PS3 Firmware
[Reply]
I had the same problem with Wordpress 2.6 I cut and pasted your code in to my style sheet and it worked beautifully, thanks!
[Reply]
[...] with Wordpress 2.6. The problem was images do not align properly when centered. Here is the link which solved the problem. Just a little mod to your theme’s [...]
[...] However, since I earn a little from blogging, let me share with you my thoughts on Wordpress 2.7. The new Wordpress firmware’s features sound really enticing. However, I also know that some of you are apprehended to upgrade (just like myself) inasmuch as problems with Wordpress upgrades have been encountered in the past. This is old news for old-time Wordpress users. In fact, I have documented in this site some of those Wordpress problems and errors which started to become more prominent starting with Wordpress 2.6. [...]
I just wanted to say THANK YOU for this style code - I’ve been digging around for ages trying to find a fix for alignment problems with images since upgrading to wp 2.7 - and this now does the trick for the Mimbo theme.
Thanks again!!
J Michael’s last blog post..NASA Searches for Chilly Rubber Ducks
[Reply]
jessie reply on January 5th, 2009:
Michael,
No problem. It’s my pleasure to be of help. Enjoy blogging!
jessie’s last blog post..Jett Travolta and Kawasaki Syndrome/Disease
[Reply]