WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: NextGEN Gallery] Title Under Thumbs (12 posts)

  1. roynorry
    Member
    Posted 4 years ago #

    I am working on a site that was installed by someone else. Before I started working on it, the gallery would display thumbs of pictures with the title of each picture shown beneath the thumbs.

    There was a message to 'upgrade' the gallery in WP and so I did that. Now all the titles have gone from beneath the thumbs and I can find no option to switch them back on.

    All the titles are showing in the Alt & Title Text / Description boxes in the 'Manage Gallery' back end but not showing beneath the thumbs any more on the public side of viewing the gallery.

    What has happened to make them disappear and how do I get then to display again?

    Thanks.

  2. medinauta
    Member
    Posted 4 years ago #

    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.

  3. retrobou
    Member
    Posted 4 years ago #

    Oh thank you thank you...this was driving me crazy!

  4. waterstones
    Member
    Posted 4 years ago #

    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!

  5. Matthias Honert
    Member
    Posted 4 years ago #

    @ 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

  6. saintlaurent
    Member
    Posted 4 years ago #

    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.

  7. saintlaurent
    Member
    Posted 4 years ago #

    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; ?>
  8. sieborg
    Member
    Posted 3 years ago #

    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.

  9. max900
    Member
    Posted 3 years ago #

    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?

  10. tabhastal
    Member
    Posted 3 years ago #

    [ nggallery id=x template=caption ] without the spaces

  11. max900
    Member
    Posted 3 years ago #

    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."????

  12. sieborg
    Member
    Posted 3 years ago #

    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 :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.