How to get wp-caption working in Wordpress 2.6
So I have finally updated my blog to Wordpress 2.6 and I wanted to try its new features. Just before this new release, I was looking for a plugin that can caption images. It’s a pretty neat feature of wordpress 2.6. So I went ahead and tried. What happened was that there was no style. It didn’t look good. I went ahead and took a look at my page’s source and tried to edit CSS but it didn’t work.
But yesterday, I found this codex article at wordpress dot org. It has fixed the problem. Here is the code block that you need to in order for it to work with style;
.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;
}
Of course you can edit this as you want to fit to your custom wordpress theme. I have changed couple of things and here is how it looks;

This is a picture I took in St. Petersburg in Russia.
Cialis Generico 2:33 AM on August 5, 2008 Permalink
Excellent post. good luck.
stefan 2:10 AM on August 14, 2008 Permalink
thanks! just what i was looking for!
copy – paste and it works!
How to get Image Captions to work in Wordpress 2.6 by Robert Merrill 12:31 PM on August 20, 2008 Permalink
[...] tenth blog already posted some cool CSS code to add to your theme’s stylesheet to make this [...]
Dale Sackrider, II 9:56 AM on August 30, 2008 Permalink
Thank you – this is exactly what I was looking for…
Alex 4:22 AM on September 12, 2008 Permalink
Thanks for this fix mate, really drove me nuts not getting it to work! Much appreciated!
kris 2:23 PM on September 14, 2008 Permalink
thanks so much for this! exactly what i was looking for.
How to get Image Captions to work in Wordpress 2.6 | Utah Tech Jobs 12:56 PM on September 22, 2008 Permalink
[...] tenth blog already posted some cool CSS code to add to your theme’s stylesheet to make this [...]
Setu Garg 9:54 AM on October 20, 2008 Permalink
Thanks!
This was helpful
.
YO might want to add text-align:center to the last one as some themes have the text justified which makes it align to the left.
Nicholas 5:42 AM on November 15, 2008 Permalink
Thank you very much. I’ve also copy&pasted the CSS code.
antiquarian books 8:24 AM on December 11, 2008 Permalink
Thank you for this information.
nacho 5:10 PM on December 19, 2008 Permalink
Thanks a lot, copy&paste and minor mods and, lots of time saved!
Peter 4:41 AM on February 15, 2009 Permalink
Thanks. Wondering why this isn’t inluded in Wordpress since it is used. Strange. Anyway, just copy and paste and now it’s on the site.
Ozgur 8:32 PM on March 9, 2009 Permalink
Thank you, good information
Estilo CSS para wp-caption en Wordpress | nosoloCodigo 4:10 PM on May 1, 2009 Permalink
[...] wp-caption para mejorar la visualización y añadir pie de foto si se quiere. He encontrado unos estilos CSS que son muy fáciles de aplicar y queda muy bien. Autor : david [...]
Glauco 12:46 AM on May 23, 2009 Permalink
Great! Now this feature works in my bloglauco.com.
However, I don’t understand why images with captions do not center in the page. This works when I set align LEFT or RIGHT, but not CENTER. Strange, isn’t it? Anybody could help me please?
Example: take a look at this post from my blog:
http://tinyurl.com/pv2pjz
Imagens are at left.
Glauco 1:27 AM on May 23, 2009 Permalink
Hey, I could fix the code. It’s OK now. Thanks.
How to get wp-caption working in Wordpress 2.6 | Tenth Blog | Squico 9:00 AM on July 19, 2009 Permalink
[...] In: Wordpress themes 19 Jul 2009 Go to Source [...]
Justin 9:25 AM on September 17, 2009 Permalink
Great post! I’m using it in my blog now. I also stumbled it for you.
David Robertson 7:50 AM on October 1, 2009 Permalink
Many thanks for this.
Julian 6:14 AM on January 13, 2010 Permalink
Excellent code, looks very nice!
Jeremy 12:39 PM on January 26, 2010 Permalink
Do I make this change in my style.css file?
Tenth Blogger 9:27 PM on January 27, 2010 Permalink
yes that’s correct
Jeremy 8:21 AM on January 28, 2010 Permalink
Thank you VERY much the help. The only things I needed to add were:
.wp-caption.alignleft{
float: left;
padding: 3px 3px 0pt !important
}
.wp-caption.alignright{
float: right;
padding: 3px 3px 0pt !important
}