• bhomatude

    (@bhomatude)


    I’ve successfully linked thumbnails to a url in a custom field… But I’m wondering if I could have the option for some thumbnails to link to their default lightbox behavior? In order to link to a url, I had to turn off lightbox behavior though.

    I’m using nextgen gallery pro and am altering the nextgen_pro_thumbnail_grid.php file.

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

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

    (@shauno)

    You could, but you would need to start doing conditionals in the gallery template.
    Add another field called something like “Use Custom Link” with drop down options “Yes” and “No”.

    Then something like

    <?php if(nggcf_get_field($image->pid, "Use Custom Link") == "Yes") { ?>
    	<!-- Custom link href here -->
    	<a href="<?php echo nggcf_get_field($image->pid, "Link Field") ?>">
    <?php }else { ?>
    	<!-- Normal NGG link href here
    	<a href="<?php echo esc_attr($storage->get_image_url($image, 'full', TRUE))?>]">
    <?php } ?>

    This is untested, just to show you the idea.

Viewing 1 replies (of 1 total)
  • The topic ‘Link to url — But sometimes link to lightbox image’ is closed to new replies.