Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor photocrati

    (@photocrati)

    @albertowordpress – There is no current method to link to an external URL from images in NextGEN Gallery displays. Please feel free to add your thoughts and ideas to this Feature Request here: https://nextgen-gallery.com/feature-voting/

    Thanks!

    – Cais.

    NGG version: 2.0.66.37

    This can be made to work with code changes in two files.

    In file:
    …/nextgen-gallery/products/photocrati_nextgen
    /modules/nextgen_basic_gallery/static/slideshow/nextgen_basic_slideshow.js

    Comment out line 43:

    // next: self, // advance to next image when clicked

    This removes the click to next image code.

    In file:
    …/nextgen-gallery/products/photocrati_nextgen
    /modules/nextgen_basic_gallery/templates/slideshow/index.php

    Starting line 56:

    Replace

    <img data-image-id='<?php echo esc_attr($image->pid); ?>'
    title="<?php echo esc_attr($image->description)?>"
    alt="<?php echo esc_attr($image->alttext)?>"
    src="<?php echo esc_attr($storage->get_image_url($image, 'full', TRUE))?>"
    width="<?php echo esc_attr($image_size['width'])?>"
    height="<?php echo esc_attr($image_size['height'])?>"/>

    With:

    <?php
    	$description_temp = (esc_attr($image->description));
    	if ($description_temp != null) {
    ?>
    	<a href="<?php echo esc_attr($image->description)?>" target="_blank">
    	<img data-image-id='<?php echo esc_attr($image->pid); ?>'
    	title="<?php echo esc_attr($image->description)?>"
    	alt="<?php echo esc_attr($image->alttext)?>"
    	src="<?php echo esc_attr($storage->get_image_url($image, 'full', TRUE))?>"
    	width="<?php echo esc_attr($image_size['width'])?>"
    	height="<?php echo esc_attr($image_size['height'])?>"/>
    	</a>
    <?php } else { ?>
    	<img data-image-id='<?php echo esc_attr($image->pid); ?>'
    	title="<?php echo esc_attr($image->description)?>"
    	alt="<?php echo esc_attr($image->alttext)?>"
    	src="<?php echo esc_attr($storage->get_image_url($image, 'full', TRUE))?>"
    	width="<?php echo esc_attr($image_size['width'])?>"
    	height="<?php echo esc_attr($image_size['height'])?>"/>
    <?php }; ?>

    Then…

    Gallery > Manage Galleries > Edit your gallery

    Then add the URL in the slide’s Description box, the second box under the “Alt & Title Text / Description”

    Leave it blank if you don’t want it linked.

    Plugin Contributor photocrati

    (@photocrati)

    @ronr1999 – Thanks for sharing this.

    – Cais.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘link to post when click in imahe’ is closed to new replies.