WordPress 2.6 Image caption align fix
mandag, juli 21st, 2008
I’ve been just updating my blog with WordPress 2.6 – an upgrade which I’m very pleased of, with lots of  new functions added.
The far most usefull one is the Image Captions, which allows your to upload, modify, and *finally* add text below the picture inserted. Though, like most other people I use a custom theme on my blog which doesn’t have the CSS-classes build for the new WP 2.6. Because of this the «alignleft, Â alignright and centered» classes does NOT exist on WP themes build on WP 2.5 and earlier. We then have to define these CSS-classes in our «style.css» file in the «themes/mytheme» folder. Simply add these lines to the file and save:
/**** WordPress 2.6 Caption Align-class update *****/
img.centered {
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;
}
/**** END caption-class ****/
Now you may still have problems if your theme has been highly modified. You may then look at the sourcecode of you website and see if the classes come up, and look after other CSS code with may interfere with the one from the Image Caption. By default this is not a problem.
I found the workout on this page:
http://wordpress.org/support/topic/164999
After reading on this thread:
http://wordpress.org/support/topic/189480
Hope it helps!
I’ve been just updating my blog with WordPress 2.6 – an upgrade which I’m very pleased of, with lots of  new functions added.
The far most usefull one is the Image Captions, which allows your to upload, modify, and *finally* add text below the picture inserted. Though, like most other people I use a custom theme on my blog which doesn’t have the CSS-classes build for the new WP 2.6. Because of this the «alignleft, Â alignright and centered» classes does NOT exist on WP themes build on WP 2.5 and earlier. We then have to define these CSS-classes in our «style.css» file in the «themes/mytheme» folder. Simply add these lines to the file and save:
/**** WordPress 2.6 Caption Align-class update *****/ img.centered { 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; } /**** END caption-class ****/
Now you may still have problems if your theme has been highly modified. You may then look at the sourcecode of you website and see if the classes come up, and look after other CSS code with may interfere with the one from the Image Caption. By default this is not a problem.
I found the workout on this page:
http://wordpress.org/support/topic/164999
After reading on this thread:
http://wordpress.org/support/topic/189480
Hope it helps!