Created
April 19, 2013 04:19
-
-
Save rugor/5418127 to your computer and use it in GitHub Desktop.
PHP: Wordpress nextgen gallery template file flexslider with carousel thumbnails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for such great help, but wanted to know about below variables.
So $gallery is my gallery id, what we have to store in $images & $pagination ?