Hi, I guess that the other guy modify the template of the gallery in use.
[NGG uses the first field (alt) as the image alt tag, the other field (Title Text / Description) is used as the link and image title tag]
If you want to use the “Title Text / Description” text as the thumbnail “title” then use answer A, if you want to use the “Alt” text as the thumbnail “title”, use answer B.
Answer A:
1. Go to “/wp-content/plugins/nextgen-gallery/view/” and rename the file “gallery.php” for something else (ie: gallery.old) and rename the file “gallery-caption.php” to “gallery.php”
2. Save and upload
Answer B:
1. Go to “/wp-content/plugins/nextgen-gallery/view/” and open gallery.php
2. Look for:
<!-- 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" >
<a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> >
<?php if ( !$image->hidden ) { ?>
<img title="<?php echo $image->description ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> />
<?php } ?>
</a>
</div>
</div>
3. Change it to:
<!-- 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" >
<a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> >
<?php if ( !$image->hidden ) { ?>
<img title="<?php echo $image->description ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> />
<?php } ?>
</a>
<span><?php echo $image->alttext ?></span>
</div>
</div>
(just need to add the <span> line, the third line from the bottom)
4. Save and upload.
Hope this help you.
Oh thank you thank you…this was driving me crazy!
This works for putting a caption under the thumbnail, but when clicking on the thumbnail no text appears under the larger image. How could we get the description to appear there?
Thank you!
@ waterstone
combine following links and you have caption on thumbnails and larger images, too:
http://narasopa.com/seoblog/2009/02/adding-title-and-description-to-nextgen-gallery-thumbnails/
http://j.modjeska.us/?p=113
<!-- Thumbnails -->
<?php foreach ($images as $image) : ?>
<?php
// BEGIN HACK
// Case if description present
if ( strlen($image->description) > 1 )
{
$newdesc = "<b>" . $image->alttext .
"</b>" . " :: " . $image->description;
}
// Case if no description
else {
$newdesc = "<b>" . $image->alttext . "</b>";
}
// END HACK
?>
<div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $gallery->imagewidth ?> >
<div class="ngg-gallery-thumbnail" >
<div class="ngg-gallery-imagewrap">
<a href="<?php echo $image->imageURL ?>" title="<?php echo $newdesc ?>" <?php echo $image->thumbcode ?> >
<img title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" border="0" <?php echo $image->size ?> />
</a></div>
<p align="left" style="margin-left:0px;"><strong><?php echo $image->alttext ?></strong><br />
<?php echo $image->description ?></p>
</div>
</div>
<?php if ( $gallery->columns > 0 && ++$i % $gallery->columns == 0 ) { ?>
<br style="clear: both" />
<?php } ?>
<?php endforeach; ?>
cheers
Hey thank you for this. Any idea on how to display the tags either under or over the thumbnail? I am using tags to give credit to the photographers in my gallery.
Hello, sorry for posting again so quickly but I found the answer to my problems. I’ll post here because it might interest others who are trying to display info about the thumbs.
<?php $tags = wp_get_object_terms($image->pid,'ngg_tag') ?>
<?php foreach ( $tags as $tag ) : ?>
<?php echo $tag->name; ?>
<?php endforeach; ?>
Hello,
I have difficulties making the image title show up under the thumbs. I have applied the “Answer A” from medinauta but nothing appears…
I would simply like to have the name of the picture under the thumbs. Is this possible? I am looking since hours and I am a bit desperate…
Thank you for your support.
any easy way for those of not versed in code/php to add titles under thumbnails and still have a description after clicking the thumbnail?
[ nggallery id=x template=caption ] without the spaces
i finally got it to work. thanks. is there any way to make the title underneath the thumbnail and the description in what pops up different? so i could label a thumbnail “pic 1” underneath and then when they click on it i could have a description that says “this is me in china in 2008.”????
Hi, I applied successfully the method of saintlaurent 5 posts before this one, thank you :). I just wonder, is there a way to display the file name instead of the description? I have a large amount of pictures (about 4000) and I would need to copy/paste the name for every single file otherwise… So is there a way to display the name instead of the description?
Thanks 🙂