I have created a Gallery using WordPress on the editor, now I’ am trying to get the images url and the caption of the image. From the function follow I’ am only able to get the URL and ID’s but now the caption.
<?php
$gallery = get_post_gallery( get_the_ID(), false );
var_dump( $gallery );
?>
This is how the var_dump results show
array(2) {
["ids"]=>
string(19) "199,198,197,195,196"
["src"]=>
array(5) {
[0]=>
string(83) "http://developers.pacificagencies.com/wp-content/uploads/2014/04/fff-10-150x150.png"
[1]=>
string(82) "http://developers.pacificagencies.com/wp-content/uploads/2014/04/fff-9-150x150.png"
[2]=>
string(82) "http://developers.pacificagencies.com/wp-content/uploads/2014/04/fff-8-150x150.png"
[3]=>
string(82) "http://developers.pacificagencies.com/wp-content/uploads/2014/04/fff-6-150x150.png"
[4]=>
string(82) "http://developers.pacificagencies.com/wp-content/uploads/2014/04/fff-7-150x150.png"
}
}
Is there anything else I have to in place to get the caption of the image?
I think this will help you.