Howdy, I’m working on this little bit of code that finds all of the images associated with a post and then displays them in the way I want them. I’m looking for a way to grab the caption (or title) to an image. Any help is appreciated!
<?php
$default_size = 'medium';
$files = get_children("post_parent=$id&post_type=attachment&post_mime_type=image&order=ASC&orderby=menu_order ID");
if($files){
$keys = array_keys($files);
foreach ($keys as $value) {
$thumb=wp_get_attachment_image_src($value,$default_size);
$caption=?????????
print "{url: '$thumb[0]', title: '$caption'},";
}
}
?>
I’m looking for what code I could replace my ?????? above with to grab the caption for the image?