Title: Image voting
Last modified: August 20, 2016

---

# Image voting

 *  [Chris](https://wordpress.org/support/users/sirchmegmailcom/)
 * (@sirchmegmailcom)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/image-voting/)
 * Hey there,
 * I apologise in advance if I seem daft. I have read all threads I could find on
   this topic, and followed the FAQ instructions for inserting the code to get image
   voting working, and worked the settings in ‘manage gallery’ on my site’s backend,
   but cannot get the image voring to work.
    I have not updated NGG or NGG voting
   either.
 * Please help. Here is a copy of the gallery.php file with the code inserted at
   line 45:
 *     ```
       <?php
       /**
       Template Page for the gallery overview
   
       Follow variables are useable :
   
       	$gallery     : Contain all about the gallery
       	$images      : Contain all images, path, title
       	$pagination  : Contain the pagination content
   
        You can check the content when you insert the tag <?php var_dump($variable) ?>
        If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?>
       **/
       ?>
       <?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($gallery)) : ?>
   
       <div class="ngg-galleryoverview" id="<?php echo $gallery->anchor ?>">
   
       <?php if ($gallery->show_slideshow) { ?>
       	<!-- Slideshow link -->
       	<div class="slideshowlink">
       		<a class="slideshowlink" href="<?php echo $gallery->slideshow_link ?>">
       			<?php echo $gallery->slideshow_link_text ?>
       		</a>
       	</div>
       <?php } ?>
   
       <?php if ($gallery->show_piclens) { ?>
       	<!-- Piclense link -->
       	<div class="piclenselink">
       		<a class="piclenselink" href="<?php echo $gallery->piclens_link ?>">
       			<?php _e('[View with PicLens]','nggallery'); ?>
       		</a>
       	</div>
       <?php } ?>
   
       	<!-- 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 echo nggv_imageVoteForm($image->pid); ?>
       				<?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>
   
       	<?php if ( $image->hidden ) continue; ?>
       	<?php if ( $gallery->columns > 0 && ++$i % $gallery->columns == 0 ) { ?>
       		<br style="clear: both" />
       	<?php } ?>
   
        	<?php endforeach; ?>
   
       	<!-- Pagination -->
        	<?php echo $pagination ?>
   
       </div>
   
       <?php endif; ?>
       ```
   
 * [http://wordpress.org/extend/plugins/nextgen-gallery-voting/](http://wordpress.org/extend/plugins/nextgen-gallery-voting/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [shauno](https://wordpress.org/support/users/shauno/)
 * (@shauno)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/image-voting/#post-3566575)
 * Hi Chris
 * You need to move the vote form tag outside of the `<a>` tag wrapping the image.
   Let me know if that sorts it out, or there are any more issues
 *  Thread Starter [Chris](https://wordpress.org/support/users/sirchmegmailcom/)
 * (@sirchmegmailcom)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/image-voting/#post-3566577)
 * Thanks mate. Done that, but nothing. Here is the file after the change. I’m learning,
   so please excuse if it is a balls-up.
 *     ```
       <?php
       /**
       Template Page for the gallery overview
   
       Follow variables are useable :
   
       	$gallery     : Contain all about the gallery
       	$images      : Contain all images, path, title
       	$pagination  : Contain the pagination content
   
        You can check the content when you insert the tag <?php var_dump($variable) ?>
        If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?>
       **/
       ?>
       <?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($gallery)) : ?>
   
       <div class="ngg-galleryoverview" id="<?php echo $gallery->anchor ?>">
   
       <?php if ($gallery->show_slideshow) { ?>
       	<!-- Slideshow link -->
       	<div class="slideshowlink">
       		<a class="slideshowlink" href="<?php echo $gallery->slideshow_link ?>">
       			<?php echo $gallery->slideshow_link_text ?>
       		</a>
       	</div>
       <?php } ?>
   
       <?php if ($gallery->show_piclens) { ?>
       	<!-- Piclense link -->
       	<div class="piclenselink">
       		<a class="piclenselink" href="<?php echo $gallery->piclens_link ?>">
       			<?php _e('[View with PicLens]','nggallery'); ?>
       		</a>
       	</div>
       <?php } ?>
   
       	<!-- 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->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> />
       				<?php } ?>
       			</a>
                           <?php echo nggv_imageVoteForm($image->pid); ?>
       		</div>
       	</div>
   
       	<?php if ( $image->hidden ) continue; ?>
       	<?php if ( $gallery->columns > 0 && ++$i % $gallery->columns == 0 ) { ?>
       		<br style="clear: both" />
       	<?php } ?>
   
        	<?php endforeach; ?>
   
       	<!-- Pagination -->
        	<?php echo $pagination ?>
   
       </div>
   
       <?php endif; ?>
       ```
   
 *  Thread Starter [Chris](https://wordpress.org/support/users/sirchmegmailcom/)
 * (@sirchmegmailcom)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/image-voting/#post-3566585)
 * Sorry mate, and another thing. The shortcode for the page/post the gallery is
   on, does it need to look like this:
 * [ nggallery id=1 template=ngg-voting ] ?
 *  Plugin Author [shauno](https://wordpress.org/support/users/shauno/)
 * (@shauno)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/image-voting/#post-3566593)
 * You don’t need the ‘`template=ngg-voting`“, unless you are creating a whole new
   template yourself. NGG will use the ‘`gallery.php`‘ template for the shrotcode`[
   nggallery id=1]`
 * It sound’s like you’ve done everything right, so the voting should work. Is it
   showing on the screen, but just now working when you click it, or is it not showing
   at all?
 *  [thaiscapes](https://wordpress.org/support/users/dragonc/)
 * (@dragonc)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/image-voting/#post-3566677)
 * I have the same issue, the image voting doesn’t show up at all. I’ve added the
   line exactly as above. Using star ratings.
    [http://www.asiaout.org/working-stiffs/](http://www.asiaout.org/working-stiffs/)
 *  Plugin Author [shauno](https://wordpress.org/support/users/shauno/)
 * (@shauno)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/image-voting/#post-3566678)
 * Have you enabled voting for the images in the gallery you are viewing. The ‘default
   settings’ screen for NGG Voting, only sets the defaults for new images added.
   You need to enable voting on existing images in NGG’s ‘Manage Gallery’ screen.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Image voting’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/nextgen-gallery-voting.svg)
 * [NextGEN Gallery Voting](https://wordpress.org/plugins/nextgen-gallery-voting/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery-voting/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery-voting/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery-voting/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery-voting/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery-voting/reviews/)

## Tags

 * [image](https://wordpress.org/support/topic-tag/image/)

 * 6 replies
 * 3 participants
 * Last reply from: [shauno](https://wordpress.org/support/users/shauno/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/image-voting/#post-3566678)
 * Status: not resolved