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/.
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.
Templates are used by adding template=template_name to the shortcode. For example:
[gallery id=9 template=template_name]
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:
- The ngg_render_template filter. This is for plugin and theme authors. Click the filter for more information.
- In the nggallery folder inside your theme folder (e.g. wp-content/themes/twentyfourteen/nggallery/). This is where you can add your custom templates.
- 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/).
- If nothing is found there, NextCellent will go through this cycle again, but looking for gallery.php this time.