I have a php loop that loads some images onto some slider:
<div id="slider" class="flexslider">
<ul class="slides">
foreach($imglist as $image) {
$caption = // I am populating this variable from the image meta data
echo '<li><img src="'.$img_folder.$image.'">';
}
</ul>
</div>
<div id="caption-block" class="myNewDiv">
<p>
echo $caption;
</p>
</div>
I am also pulling meta data from the image and loading each meta data. My question has to do with the fact that I would like to load the caption outside of the in which the loop resides onto a separate . As you can probably infer, the code I have written does not work because $caption is not dynamically loaded as it's not inside the loop.
Is it possible to have the $caption which is on a separate div be populated dynamically with php? If so, what's the best approach?
$caption =to$image