WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
Make a Gallery Image a Link (5 posts)

  1. kevin.wilescg
    Member
    Posted 2 years ago #

    Hi

    I am looking to make each gallery image a link, does anyone know if this can be done I have not found a guide or anything for it so any help would be much appreciated!

    The guide I did find didn’t work

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

  2. kevin.wilescg
    Member
    Posted 2 years ago #

    Anyone? The site is http://www.calgavin.com I am trying to make the main header images a link!

  3. jmek
    Member
    Posted 2 years ago #

    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.

  4. jmek
    Member
    Posted 2 years ago #

    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

  5. kevin.wilescg
    Member
    Posted 2 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.