WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
[resolved] Display image name under thumbs (4 posts)

  1. LogoLogics
    Member
    Posted 1 year ago #

    Hello,

    Before the most recent update I used this tip/code to display image name under the thumbs. Now thats gone. Here: http://wordpress.org/support/topic/plugin-nextgen-gallery-display-image-name-under-thumbs?replies=5 I found the code, but it does not say where exactly to put in the gallery.php?

    Where do I have to put this code please?
    Further more, earlier before the update, there was a problem:
    If the first word of the name was short for ex. john the rest of the name was automatiquely put on a second line unther the image. Can this be fixed too?

    Thx!

    http://wordpress.org/extend/plugins/nextgen-gallery/

  2. shauno
    Member
    Posted 1 year ago #

    Firstly, move the NGG templates into a new directory called 'nggallery' inside your theme. This will prevent them from being overwritten the next time NGG updates.

    To show the description for the image, put this piece of code inside the foreach loop outputting the images in the gallery template:
    <?php echo $image->description; ?>

    If it wraps, it's because there isn't enough horizontal room to fit the text. You will need to tweak your template/css to accommodate the text in that case

  3. LogoLogics
    Member
    Posted 1 year ago #

    Hello,

    Thx for your answer.

    If I move the templates into another location, Wp wont find them anymore? If I upload them right into NGG it puts them automaticly in the gallery folder. How do I do that please?

    About the code. I opened the gallery.php and put the code in the foreach loop:

    <!-- Thumbnails -->
    	<?php foreach ( $images as $image ) : ?>
    	<?php echo $image->description; ?>
    
    	<div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $image->style ?> >
    		<div class="ngg-gallery-thumbnail" >
    			<a>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 } ?><?php echo nggv_imageVoteForm($image->pid); ?>
    			</a>
    		</div>
    	</div>
    
    	<?php if ( $image->hidden ) continue; ?>
    	<?php if ( $gallery->columns > 0 && ++$i % $gallery->columns == 0 ) { ?>
    		<br style="clear: both" />
    	<?php } ?>
    <?php echo $image->description; ?>
    
    <?php endforeach; ?>

    [Please post code between backticks or use the code button. Your posted code has now been permanently damaged by the forum's parser.]

    This does not put the names of the images back under the image as before the update? Am I doing something wrong?

    Thx,
    Annie

  4. LogoLogics
    Member
    Posted 1 year ago #

    Hello,

    Just letting you know that the names are back under the images now.
    Thx for your help!

    Annie

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic