Templates

What are templates?

Templates are the files NextCellent uses to display your content (e.g. galleries, slideshows, etc.). The default templates are located in wp-content/plugins/nextcellent-gallery/view/.

A full list of templates can be found here.

Custom templates

Of course, you can add custom templates. This way you can edit the way NextCellent outputs the shortcodes. With custom templates, you can add as many as you want. Custom templates are also upgrade-safe, i.e. they will not be removed with a plugin update.

Using templates

Templates are used by adding template=template_name to the shortcode. For example:

[gallery id=9 template=template_name]

Naming templates

NextCellent templates are named according to with which shortcode they can be used, and then by adding -template_name.

  • Albums: album-template_name.php
  • Galleries: gallery-template_name.php
  • Image browsers: imagebrowser-template_name.php
  • Single pictures: singlepic-template_name.php

Loading and saving templates

Assuming our template is called gallery-template_name.php, NextCellent tries to load the template in this order:

  1. The ngg_render_template filter. This is for plugin and theme authors. Click the filter for more information.
  2. In the nggallery folder inside your theme folder (e.g. wp-content/themes/twentyfourteen/nggallery/). This is where you can add your custom templates.
  3. If NextCellent can’t find gallery-template_name.php, it will look for the file in the view folder (wp-content/plugins/nextcellent-gallery/view/).
  4. If nothing is found there, NextCellent will go through this cycle again, but looking for gallery.php this time.

Themes and plugins should add templates using the filter ngg_render_template. If you want to add a template yourself, add them in the nggallery folder (or follow this guide).

Sub Wikis