[Plugin: NextGEN Gallery] show Title alt of image instead

 

view/gallery.php.

 

<!– Thumbnails –>
<?php foreach ( $images as $image ) : ?>
 
<div id=”ngg-image-<?php echo $image->pid ?>” class=”ngg-gallery-thumbnail-box” <?php echo $image->style ?> >
<div class=”ngg-gallery-thumbnail” >
<?php echo $image->alttext ?>
<a href=”<?php echo $image->imageURL ?>” title=”<?php echo $image->description ?>” <?php echo $image->thumbcode ?> >
<?php if ( !$image->hidden ) { ?>
<img title=”<?php echo $image->alttext ?>” alt=”<?php echo $image->alttext ?>” src=”<?php echo $image->thumbnailURL ?>” <?php echo $image->size ?> />
<?php } ?>
</a>
</div>
</div>

———————————————————————-

In the nextgen plugin dir, edit the file view/gallery.php.

Find the line of code for the anchor (link) around the thumbnail:

<a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> >

Replace the title attribute with:
<?php echo $image->alttext ?>

Result:
<a href="<?php echo $image->imageURL ?>" title="<?php echo $image->alttext ?>" <?php echo $image->thumbcode ?> >

Explanation: The effects like the Shutter box use the anchor title attribute to display text under the image. NextGen defaults this to the description field, but the edit above will replace this default with the alttext field.

Hope that helps!