Created
November 25, 2016 09:57
-
-
Save karki-dennis/4078aac49bd0cd24b601560f4df8473b to your computer and use it in GitHub Desktop.
ng gallery custom loop to acess gallery
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 | |
$code = get_field('ng_gallery_code'); | |
if ($code): | |
?> | |
<?php | |
global $nggdb; | |
$gallery = $nggdb->get_gallery($code, 'sortorder', 'ASC', true, 0, 0); | |
if ($gallery): | |
?> | |
<div class="trip-gallery"> | |
<?php | |
foreach ($gallery as $image) { | |
/*echo $image->description;*/ | |
?> | |
<a class="fancybox-thumbs" data-fancybox-group="thumb" | |
href="<?php echo $image->imageURL; ?>"><img src="<?php echo $image->imageURL; ?>" | |
alt="<?php echo $image->alttext; ?>"/></a> | |
<?php } ?> | |
</div> | |
<?php | |
endif; | |
endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment