[Plug-In : NextGEN Gallery] Need help with custom gallery template
-
Hi!
I was hoping to make a new template for galleries instead of entering all the code in the post, but I must be doing something wrong since I’m getting the “Rendering of template gallery-test.php failed” message.
It’s pretty simple; on the page, I’d like to have the name of the gallery as a title, then the description text of the gallery, then my block of thumbnails. It should look the way it does there (where everything that’s not thumbnails is coded into the post instead of the template):
https://www.karlotta.com/portfolio/lively
I made a gallery-test.php template, which looks like this:
<?php /** Template Page for the gallery overview Follow variables are useable : $gallery : Contain all about the gallery $images : Contain all images, path, title $pagination : Contain the pagination content You can check the content when you insert the tag <?php var_dump($variable) ?> If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?> **/ ?> <?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($gallery)) : ?> /** HERE'S WHAT I ADDED! **/ <div id="gallery-text"> <p><span class="title"><?php echo $gallery->title ?></span></p> <p> </p> <p><?php echo $gallery->description ?></p> </div> /** REGULAR TEMPLATE STARTS AGAIN **/ <div class="ngg-galleryoverview" id="<?php echo $gallery->anchor ?>"> <!-- Thumbnails --> <?php foreach ( $images as $image ) : ?> <div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $image->style ?> > <div class="ngg-gallery-thumbnail" > <a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> > <?php if ( !$image->hidden ) { ?> <img title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> /> <?php } ?> </a> </div> </div> <?php if ( $image->hidden ) continue; ?> <?php if ( $gallery->columns > 0 && ++$i % $gallery->columns == 0 ) { ?> <br style="clear: both" /> <?php } ?> <?php endforeach; ?> <!-- Pagination --> <?php echo $pagination ?> </div> <?php endif; ?>
but I’m getting the error message. What am I doing wrong?
Thanks for your help!
- The topic ‘[Plug-In : NextGEN Gallery] Need help with custom gallery template’ is closed to new replies.