single-image-shortcode

single-image-shortcodeSome users were asking for a shortcode on how to launch the Pro Lightbox from a single image.  But they wanted the Pro Lightbox to display an entire gallery's images.

NextGEN Gallery doesn't not currently have a basic shortcode for the task, but with a bunch of parameters, it is very possible to do.

Here is an example of a Basic Thumbnail Gallery with only 1 image.

Here is an example of a Pro Thumbnail Grid with only 1 image.

If you'd like to use these shortcodes (and modify them to your needs, grab the text below.

As you can see, the Pro Thumbnail Grid version is centered, which is happening because the Pro Thumbnail Grid is centered by default. In theory this shortcode is displaying an entire gallery, but only showing 1 image per page with pagination disabled.

Here are what the parameters mean:

  • gallery_ids=1 - which gallery ID to display
  • display_type=photocrati-nextgen_pro_thumbnail_grid - which gallery display type to use
  • disable_pagination=1 - disable pagination for the gallery
  • images_per_page=1 - display only 1 image per page
  • show_all_in_lightbox=1 - display the entire gallery in the Pro Lightbox

For those interesting in taking advantage of this shortcode setup, we hope you enjoy it.

As always, please contact support with any questions you may have!

This Post Has 13 Comments

  1. This should work out perfectly for me.

    Where can I enter the short code for this ? in the code section of the Page or Post ?

    Tony

  2. This is a very good Solution. Thank you!

    One more thing and it would be perfect:
    The image that is being displayed (the one you have to click on) is displayed as a thumbnail, which is too small (120px width). I would like to see the full image (250px width), but can’t change that.
    Even uploading the thumbnail as a copy of the original image fails.

    What can I do?

    Thanks a lot!

    1. The image size shown is based on the thumbnail size you create. So you can simply re-create a thumbnail larger and you’re all set.

  3. Is there any way to use this shortcode – but not show any images – rather use my own styling for a div as the link to open up the lightbox?

  4. Scott, thanks for the post, it is useful for basic stuff.

    What if I want to change the appearance of the single image leading to the pro lightbox gallery? Can I use a custom CSS as for the NG Gallery? Also, can I add some text in a specific position on top of the single image, for example, that describes the gallery to be opened?

    Finally, a more general question: Is it possible to work with a pro lightbox gallery on the level of php code? I fail to find a documentation or an example for this.

    Your answer will be much appreciated,
    Ilche

    1. You can apply custom CSS within the Other Options panel of NextGEN Gallery. Since you would be inserting the NextGEN Gallery contnet on a post or page, you can always place text above or below the shortcode.

  5. Hello,

    Great plug in thus far. New to it and I’m loving it!

    If I want to display the entire gallery in the lightbox, that is, display every image in the gallery all at once, how would I go about this?

    I tried disabling the pagination but to no avail. Current shortcode only displays 1 image with buttons to toggle through the gallery.

    Cheers,
    Sanzio

    1. What you need to use is an Album, which when a single thumbnail is clicked, displays a gallery. Please refer to our demos and documentation for more on Albums.

  6. Hi there, not sure if I’m posting this question in the right place, but please could you tell me … When I put a single image in a blog post, is there any way to make it pop up in a fancybox/lightbox when a user clicks on it?

    Thank you!
    D Green

    1. To enable lightboxes to open for any image, you can change the setting in Other Options >> Lightbox Settings to work on any image linking to an image.

Leave a Reply to Ilche Cancel reply

Close Menu