WordPress.org

Support

Support » Plugins and Hacks » NextGEN Gallery - WordPress Gallery Plugin » [Plugin: NextGEN Gallery] Make a Gallery Image a Link

[Plugin: NextGEN Gallery] Make a Gallery Image a Link

Viewing 4 replies - 1 through 4 (of 4 total)
  • Anyone? The site is http://www.calgavin.com I am trying to make the main header images a link!

    You need to add the NextGen Custom Fields template and to create an additional gallery template (gallery-linked.php, for example) in NextGen.

    First, use NextGen Custom Fields to add a “custom_link” field to your galleries, and enter the correct link URL to the field for each image.

    Then create a duplicate of nextgen-gallery/view/gallery.php and name it gallery-linked.php (put the duplicate file in the same folder as the original gallery.php).

    In gallery-linked.php, find the <!-- Thumbnails --> section and add the anchor and linking code, using the content of the custom field for your URL destination. This is what my linking code looks like in gallery-linked.php file.

    <a href="<?php echo $image->ngg_custom_fields["custom_link"]; ?>" target="_blank" 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>

    Hope that helps.

    I found the original forum post from Alex Rabe explaining how to do this hack. Probably clearer than my explanation above. It’s at: http://wordpress.org/support/topic/plugin-nextgen-gallery-is-it-possible-to-specify-url-links-in-thumbnails?replies=45

    Hi

    This doesnt work what we are trying to do is make the big slideshow images a link, http://www.calgavin.com is a good example!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: NextGEN Gallery] Make a Gallery Image a Link’ is closed to new replies.
Skip to toolbar