Hey guys,
I’m trying to display the tags that have been added to an image. I find it easy enough to display the alternate text and imageURL but I can’t seem to echo out the image tags. I can’t even see the tag property within the image object. Thanks for the help.
$ad_image = nggdb::find_image($image_id);
if($ad_image) :
$external_link = nggcf_get_field($ad_image->pid, 'External Link');
?>
<a href="<?php echo isset($external_link) ? $external_link : '#'; ?>">
<img src="<?php echo $ad_image->imageURL; ?>" alt="<?php echo $ad_image->alttext; ?>">
</a>
<?php $posttags = get_the_tags();
if ($posttags) {
foreach($posttags as $tag) {
echo $tag->name . ' ';
}
}