NextGen Shortcodes

Home »  Aide »  NextGen Shortcodes

NextGen Shortcodes

NextGEN Gallery Shortcodes

July 15, 2013 By

Note: This page describes shortcodes for NextGEN 2.0 and up. To see shortcodes for NextGEN Legacy (1.9.13 and earlier), please see our separate page on NextGEN Legacy Shortcodes


Introduction and Basic Logic

NextGEN 2.0 introduces a new short code structure. This page describes everything you need to know to work fluidly with the new shortcodes.

We should start by emphasizing that you can now customize your galleries easily using the new Attach to Post interface. For the most part, you never need to use shortcodes again if you don’t want to.

The main places we think people may want to use these are:

  • Widgets. You can’t use the Attach to Post interface within a widget, so you’d need to use a shortcode.
  • Page/Post Text Editor. If you prefer to use the text-based editor for pages or posts, you currently need to work with shortcodes, or go back and forth between visual and text editor. We are working on making the Attach to Post interface more robust for use with text-based editing.

Let’s start with a sample shortcode that includes a lot of options.

[ ngg_images gallery_ids=”1″ exclusions=”4,6″ display_type=”photocrati-nextgen_basic_slideshow” gallery_width=”600″ gallery_height=”400″ ]

The shortcode above will display gallery #1 as a NextGEN Gallery basic slideshow. It will exclude images #4 and #6 and will set the slideshow size as 600px X 400px. You would need to remove the spaces just inside the starting and ending brackets.

So that gives you a sense for what the shortcodes will look like. Now lets break them down.



This is the parameter that now introduces every NextGEN Gallery shortcode.

Image Source 

Following the ngg_images tag, identify is the source of the images you want to display. There are several options for the image source.

  • gallery_ids=”1,3″   (retrieves galleries #1 and #3)
  • album_ids=”1″   (retrieves album #1)
  • tag_ids=”landscapes,florida beaches”   (retrieves images tagged ‘landscapes’ or ‘florida beaches’)
  • image_ids=”2,3,5″   (retrieves images 2, 3, and 5)
  • source=”recent”   (retrieves recently uploaded images)
  • source=”random”   (retrieves a random set of images)

You can also chose to include or exclude specific images based on their ids.

  • gallery_ids=”1,3″ exclusions=”4,6″   (excludes images #4 and #6)
  • album_ids=”1,2″ exclusions=”a1″   (excludes sub album #1)

Display Type

Following the image source, specify the display type. Here is a list of all available display types in NextGEN Gallery and NextGEN Pro.

  • display_type=”photocrati-nextgen_basic_slideshow”
  • display_type=”photocrati-nextgen_basic_thumbnails”
  • display_type=”photocrati-nextgen_basic_imagebrowser”
  • display_type=”photocrati-nextgen_basic_singlepic”
  • display_type=”photocrati-nextgen_basic_extended_album”
  • display_type=”photocrati-nextgen_basic_compact_album”
  • display_type=”photocrati-nextgen_pro_slideshow”
  • display_type=”photocrati-nextgen_pro_thumbnail_grid”
  • display_type=”photocrati-nextgen_pro_horizontal_filmstrip”
  • display_type=”photocrati-nextgen_pro_film”
  • display_type=”photocrati-nextgen_pro_blog_gallery”
  • display_type=”photocrati-nextgen_pro_list_album”
  • display_type=”photocrati-nextgen_pro_grid_album”


Extra Parameters

For each NextGEN Gallery type, there is a large range of parameters and settings you can apply. These are all now visible in NextGEN Gallery 2.0′s new Attach to Post interface. But you can also apply them using parameters within shortcodes.

We are working on compiling an entirely complete list of every available shortcode parameter in NextGEN Gallery (there are a lot). For now, to give you a sense for what the options look like, consider the following parameters for slideshows and thumbnail galleries.

Example: Common Parameters for NextGEN Basic Slideshows

  • gallery_width=”600″
  • gallery_height=”400″
  • cycle_interval=”5″
  • flash_enabled=”1″
  • flash_shuffle=”0″
  • flash_next_on_click=”1″
  • flash_navigation_bar=”1″
  • flash_loading_icon=”1″
  • flash_watermark_logo=”0″
  • flash_stretch_image=”0″
  • flash_slow_zoom=”0″

Example: Common Parameters for NextGEN Basic Slideshows

  • override_thumbnail_settings=”1″ (required to override default thumbnail setting within shortcodes)
  • thumbnail_width=”120″
  • thumbnail_height=”80″
  • thumbnail_crop=”1″
  • thumbnail_watermark=”1″
  • number_of_columns=”0″
  • show_slideshow_link=”1″
  • slideshow_link_text=”View Slideshow”

Two general points:

  • For any parameters you do not define via shortcode, the gallery will adopt whatever default setting you have in NextGEN Gallery options panel (under Gallery > Gallery Settings). So if you don’t set the gallery width and height for a slideshow in a shortcode, the slideshow will just adopt the default gallery width and height that you’ve designated under Gallery > Gallery Settings > NextGEN Basic Slideshow.
  • For any parameters that are either Yes or No, you can use a “1″ to indicate Yes or a “0″ to indicate No.


Examples of Standard Shortcodes

Below are the standard shorcodes for NextGEN and NextGEN Pro gallery and album types. We provide this for those who would like to copy and paste the shortcodes. Please remember to delete the spaces just inside the starting and ending brackets.

NextGEN Basic Thumbnail Gallery

[ ngg_images gallery_ids=”1″ display_type=”photocrati-nextgen_basic_thumbnails” ]

NextGEN Basic Slideshow Gallery

[ ngg_images gallery_ids=”1″ display_type=”photocrati-nextgen_basic_slideshow” ]

NextGEN Basic Image Browser Gallery Gallery

[ ngg_images gallery_ids=”1″ display_type=”photocrati-nextgen_basic_imagebrowser” ]

NextGEN Basic SinglePic 

[ ngg_images gallery_ids=”1″ display_type=”photocrati-nextgen_basic_singlepic” ]

NextGEN Basic Tag Cloud

[ ngg_images gallery_ids=”1″ display_type=”photocrati-nextgen_basic_tagcloud” ]

NexGEN Basic Extended Album

[ ngg_images album_ids=”2″ display_type=”photocrati-nextgen_basic_extended_album” ]

NextGEN Basic Compact Album

[ ngg_images album_ids=”2″ display_type=”photocrati-nextgen_basic_compact_album” }

NextGEN Pro Thumbnail Gallery

[ ngg_images gallery_ids=”1″ display_type=”photocrati-nextgen_pro_slideshow” ]

NextGEN Pro Slideshow Gallery

[ ngg_images gallery_ids=”1″ display_type=”photocrati-nextgen_pro_slideshow” ]

NextGEN Pro Filmstrip Gallery

[ ngg_images gallery_ids=”1″ display_type=”photocrati-nextgen_pro_horizontal_filmstrip” ]

NextGEN Pro Film Gallery

[ ngg_images gallery_ids=”1″ display_type=”photocrati-nextgen_pro_film” ]

NextGEN Pro BlogStyle Gallery

[ ngg_images gallery_ids=”1″ display_type=”photocrati-nextgen_pro_blogstyle” ]

NextGEN Pro Grid Albu

[ ngg_images album_ids=”2″ display_type=”photocrati-nextgen_pro_grid_album” ] 

NextGEN Pro List Album

[ ngg_images album_ids=”2″ display_type=”photocrati-nextgen_pro_list_album” ]


Other Examples

Finally, we provide a few other examples to show how various image sources, gallery types, and parameters might be combined.

To retrieve images from gallery 1 & 3, but exclude images 4 & 6:

[ ngg_images gallery_ids=”1,3″ exclusions=”4,6″ display_type=”photocrati-nextgen_basic_thumbnails” ]

To retrieve images 1 & 2 from gallery 1:

[ ngg_images gallery_ids=”1″ image_ids=”1,2″ display_type=”photocrati-nextgen_basic_thumbnails” ]

To retrieve images matching tags “landscapes” and “wedding shoots”:

[ ngg_images tag_ids=”landscapes,wedding shoots” display_type=”photocrati-nextgen_basic_thumbnails” ]

To retrieve galleries from albums 1 & #, but exclude sub-album 1:

[ ngg_images album_ids=”1,2″ exclusions=”a1″ display_type=”photocrati-nextgen_basic_compact_album” ]

To retrieve galleries from albums 1 & 2, but exclude gallery 1:

[ ngg_images album_ids=”1,2″ exclusions=”1″ display_type=”photocrati-nextgen_basic_compact_album” ]

To retrieve image 2, 3, and 5 – independent of what container is used:

[ ngg_images image_ids=”2,3,5″ display_type=”photocrati-nextgen_basic_thumbnails” ]

To retrieve galleries 3 & 5, custom sorted, in album view:

[ ngg_images source=”albums” gallery_ids=”3,5″ display_type=”photocrati-nextgen_basic_compact_album” ]

To retrieve recent images, sorted by alt/title text:

[ ngg_images source=”recent” order_by=”alttext” display_type=”photocrati-nextgen_basic_thumbnails” ]

To retrieve random image:

[ ngg_images source=”random” display_type=”photocrati-nextgen_basic_thumbnails” ]

To retrieve a single image:

[ ngg_images image_ids=’8′ display_type=’photocrati-nextgen_basic_singlepic’ ]

To retrieve a tag cloud:

[ ngg_images tagcloud=yes display_type=’photocrati-nextgen_basic_tagcloud’ ]

Shortcodes HELP

*This page displays short codes for older versions of NextGEN Gallery (1.9.13 and older). For short codes for the latest versions (2.0 and up) please see our NextGEN Gallery Shortcodes page.

The legacy shortcode system will soon be deprecated as of v2.0, but will still work. We’re introducing a new interface in v2.0 for adding galleries and albums to pages/posts.

List of Short Codes

The shortcodes below will need to be added within the brackets (without the space between bracket).

Thumbnail Gallery
[ nggallery id=36 ]

will display as:

[ slideshow id=36 ]

will display as:



[ album id=5 template=compact ]

will display as:



17 Photos



18 Photos



17 Photos



14 Photos



14 Photos

[ album id=5 template=extend ]

will display as:


This is a gallery of landscape images. This is the description for the gallery. It can be edited on the Manage Gallery page.

17 Photos


This is a gallery of people images. This is the description for the gallery. You can edit the description on the Manage Gallery page.

18 Photos


This is a gallery of food images. This is the description for the gallery. You can edit the description on the Manage Gallery page.

17 Photos


This is a gallery of wedding images. This is the description for the gallery.

14 Photos


This is a gallery of adventure images. This is the description for the gallery.

14 Photos

Use Image Tags to Create Galleries/Albums
[ nggtags album=fields,blue ]

will display as:

Display Captions in Thumbnail Galleries
[ nggallery id=36 template=caption images=3 ]

will display as:

Basic Filmstrip Galleries
[ nggallery id=36 template=carousel images=6 ]

will display as:


Template Engine for Gallery Types
[ nggallery id=1 template=sample1 ]
[ nggallery id=1 template=sample2 ]
[ nggallery id=1 template=sample3 ]

*sample= the template you have created or downloaded that you are calling to as the style for the gallery. See more information here: Working with Templates…

Display Exif Data
[ imagebrowser id=36 template=exif ]


Picture 1 of 17

Before sunrise in the desert. This is an image caption.

Meta data

Camera / Type
Focal Length
Shutter speed
Date / Time

Sort Images in a Gallery Based on Their Tags
[ nggtags gallery=fields,blue ]

Integration with Third Party Plugins
[ monoslideshow id=36 w=450 h=350 ]
[monoslideshow id=36 w=450 h=350]

[ monoslideshow id=36 w=510 h=340 preset=’tv-swap’ ]
[monoslideshow id=36 w=510 h=340 preset=’tv-swap’]

[ monoslideshow id=36 w=450 h=350 preset=’sparkles’ ]
[monoslideshow id=36 w=450 h=350 preset=’sparkles’]

Add Tag Clouds
[ tagcloud ]


Single Pic Options
[ singlepic id=x w=width h=height mode=web20 ]


Additional Shortcode Tips 

  • add ‘images=x’  to shortcode, replacing x with any number to limit the amount of images per page display
  • add ‘w=800 h=533′ to shortcode,  to set the width and height of any slideshow, filmstrip or singlepic