• Resolved webAlma

    (@webalma)


    Hi, I’m able to make link from thumbnail to an external page. But how can I set link target=”_blank” so that it opens a new tab for that page? I have tried couple of ways to add this target but no luck. Could somebody please help. Here’s the code as it is now:

    <div class="ngg-gallery-thumbnail">
                   <a  href="<?php echo nggcf_get_field($image->pid, 'Link'); ?>"
                   target="<?php echo nggcf_get_field($image->pid, 'Target'); ?>"
                   title="<?php echo esc_attr($image->description); ?>"
                   data-src="<?php echo esc_attr($storage->get_image_url($image)); ?>"
                   data-thumbnail="<?php echo esc_attr($storage->get_image_url($image, 'thumb')); ?>"
                   data-image-id="<?php echo esc_attr($image->{$image->id_field}); ?>"
                   data-title="<?php echo esc_attr($image->alttext); ?>"
                   data-description="<?php echo esc_attr(stripslashes($image->description)); ?>"
                   <?php echo $effect_code ?>>
                    <img
                        title="<?php echo esc_attr($image->alttext)?>"
                        alt="<?php echo esc_attr($image->alttext)?>"
                        src="<?php echo esc_attr($storage->get_image_url($image, $thumbnail_size_name, TRUE))?>"
                        width="<?php echo esc_attr($thumb_size['width'])?>"
                        height="<?php echo esc_attr($thumb_size['height'])?>"
                        style="max-width:none;"
                    />
                </a>
            </div>

    https://wordpress.org/plugins/nextgen-gallery-custom-fields/

Viewing 1 replies (of 1 total)
  • Plugin Author shauno

    (@shauno)

    If the value of your ‘Target’ custom field is “_blank”, that will work as expected.
    If you want all the thumbnails to open in a new window, just hard-code the target="_blank".

Viewing 1 replies (of 1 total)

The topic ‘Link target "_blank" ??’ is closed to new replies.