Skip to content

Instantly share code, notes, and snippets.

@rugor
Created April 19, 2013 04:19
Show Gist options
  • Save rugor/5418127 to your computer and use it in GitHub Desktop.
Save rugor/5418127 to your computer and use it in GitHub Desktop.
PHP: Wordpress nextgen gallery template file flexslider with carousel thumbnails
<?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)) : ?>
<div class="slider">
<div id="slider" class="flexslider">
<ul class="slides">
<?php foreach ( $images as $image ) : ?>
<?php if ( !$image->hidden ) { ?><li>
<img title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->imageURL ?>" />
<span class="caption"><?php echo $image->alttext ?></span>
<span class="credit"><?php echo $image->description ?></span>
</li>
<?php } ?>
<?php if ( $image->hidden ) continue; ?>
<?php if ( $gallery->columns > 0 && ++$i % $gallery->columns == 0 ) { ?>
<?php } ?><?php endforeach; ?>
</ul>
</div>
<!-- Thumbnails -->
<div id="carousel" class="flexslider">
<ul class="slides"><?php foreach ( $images as $image ) : ?><?php if ( !$image->hidden ) { ?>
<li><img title="<?php echo $image->alttext ?>" alt="<?php echo $image->alttext ?>" src="<?php echo $image->thumbnailURL ?>" <?php echo $image->size ?> /></li>
<?php } ?>
<?php if ( $image->hidden ) continue; ?>
<?php if ( $gallery->columns > 0 && ++$i % $gallery->columns == 0 ) { ?>
<?php } ?>
<?php endforeach; ?></ul>
</div>
<?php endif; ?>
</div>
@webwebby
Copy link

Thanks for such great help, but wanted to know about below variables.

$gallery     : Contain all about the gallery
$images      : Contain all images, path, title
$pagination  : Contain the pagination content

So $gallery is my gallery id, what we have to store in $images & $pagination ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment