The nggallery Shortcode

Wikis > NextCellent Plugin > Shortcodes > The nggallery Shortcode

This shortcode, along the singlepic shortcode is one of the most used and, as you quickly will see, very versatile. This is used to display the galleries, which are the main goal and most used feature of this plugin.

In its most simple definition the shortcode looks like:

  • [nggallery id="2"/]

Basic Parameters

This is an example that uses all available options

  • [nggallery id="my_gallery_id" template ="my_template_name" images="xxx"/]

Parameters (except for id, all parameters are optional)

  • id: gallery id
  • template: the template name. For more information, see the template documentation. By default NextCellent offers two additional templates:
    • caption (uses gallery-caption.php): will display the title as a caption
    • carousel (uses gallery-carousel.php): this will display a basic carousel (a large image with the thumbnails beneath).
  • images: how many images before pagination is applied

Examples can be found on this page.

Global parameters

How the gallery is displayed also depends on a bunch of global parameters. These can be set from NextCellent Control Panel in Settings -> Gallery. In no specific order:

  • Sorting direction:  the order in which the images are displayed in a gallery. Possibilities are ascending and descending.
  • Show first: set whether to display a slideshow or a gallery on page load. These modes can be toggled from the page itself, obviously.
  • Images per page: determines how many thumbnails are shown per page. Zero value disables pagination.