WordPress.org

Support

Support » Plugins and Hacks » NextGEN Gallery - WordPress Gallery Plugin » [Plugin: NextGEN Gallery] Image name in gallery

[Plugin: NextGEN Gallery] Image name in gallery

  • I’d like the name of each image to appear under each image in the gallery. Is there an easy way to set this? I don’t mind editing code/.php files if I have to.

    Thanks!

Viewing 1 replies (of 1 total)
  • You need to add <? echo $image->filename ?> to the gallery.php file. probably about line 40 or so. I’ve modified mine a bit, but here’s how my code looks, to give you an idea on where it goes:

    <?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->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> />
    				<?php } ?>
    			</a><? echo $image->filename ?>
    		</div>
    	</div>
    
    	<?php if ( $image->hidden ) continue;
    	if ( $gallery->columns > 0 && ++$i % $gallery->columns == 0 ) {
    		print '<br style="clear: both" />';
    	}
    	endforeach; ?>

    Also, you can try <?php var_dump($gallery) ?><?php var_dump($images) ?> to see everything you can access.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: NextGEN Gallery] Image name in gallery’ is closed to new replies.
Skip to toolbar