try this code as a starting point, which needs to be added to functions.php of your theme:
[edit: pastebin code removed]
it is basically a filter which adds the caption – if one exists – to the post thumbnail output, wrapping it into a span to keep img and caption together.
the possibly needed css is in the commented area at the top of the code.
caveat: it will act on all post thumbnails site wide.
(not widely tested, and not tested with the plugin, might need adjusting the css)
Thank you. I have tried it, and what happened was that only the caption for the most recent thumbnail was shown – next to all thumbnail. If the most recent thumbnail has no caption, no captions are shown.
So it shows the caption of the last added thumbnail on all thumbnails. The plugin I am using is called ‘list category posts’: http://wordpress.org/extend/plugins/list-category-posts/
try to replace list_category_posts/include/CatList.php with this code:
http://pastebin.com/he83SGj7
(not widely tested)
an existing caption should be addded after the image, within a span with the css class .thumbnail-caption-text
;
if there is no caption, the output should be unaltered.
Thanks, but what happens now is that there are no captions, and instead of thumbnails, the full size images are shown.
Sorry. Ah, yes, the captions are there now. I had chosen a very small text size in the css, so I didn’t notice them at first. Ok. Only thing now is that in one of my widget areas, the images are shown instead of the thumbnails. I’ll investigate further and report back. It’s working ok in at least one widget area. Thanks.
Using the parameter ‘thumbnail_size’ somehow conflicted with the new code, so that the image was shown in full blown size. If I don’t use this parameter with the plugin, the caption shows. However the caption shows next to the thumbnail, and I’ll have to try to have it underneath. Thank you very much for writing this code. This is an improvement.
I use .lcp_catlist img { float: left; margin: 3px; } in style.css, so the thumbnail is to the left. To the right of it is, first, the title of the post, then its date, and then comes the caption. Then a line break, and the post excerpt, which floats around the thumbnail. The caption comes kind of in the middle of nowhere, and I want it under the thumbnail.
I changed the CatList.php so that the caption is not a span, but a div. Then added ‘clear: both’ and ‘float: left’ to this div’s properties in style.css. Now the caption appears underneath the thumbnail in a useable fashion.
Thanks a lot for your help!
This modification might be of use to others, so the author of the plugin should maybe have a note. I can send the author a mail about it.