WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
Do you want to display the IMAGE TITLE and/or the IMAGE DESCRIPTION? (READ) (4 posts)

  1. bopgun
    Member
    Posted 1 year ago #

    Do you want to display the IMAGE TITLE and/or the IMAGE DESCRIPTION below your gallery images? I found the answer a very common issue of displaying the image title and/or description.

    If you go to the plugin folder nextgen-gallery/view/gallery.php

    Step 1: Find the code:
    _________________________________________________________

    <!-- 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>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>

    ___________________________________________________________
    Step 2: Replace above code this the following code

    <!-- 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>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>
                <span><?php echo $image->description ?></span>
    		</div>
    	</div>

    ______________________________________________________________

    Note:
    This is the code to add the description
    <?php echo $image->description ?>

    This is the code to add the title
    <?php echo $image->alttext ?>

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

  2. MassimoD
    Member
    Posted 1 year ago #

    This is wrong code, in both original and modified.

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

  3. Mr.NEM
    Member
    Posted 1 year ago #

    How is it wrong code? I copy pasted his code and it's working as intended.
    The image title is correctly displayed beneath images.

  4. MassimoD
    Member
    Posted 1 year ago #

    This line is wrong !!

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

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic