I have updated the Nexgen gallery plugin and it stop showing the galleries on the page which I am getting by custom PHP code.
Here is code which I am using for getting gallery.
$nggdb = new nggdb();
$images = $nggdb->get_gallery($post->post_name, 'sortorder', 'ASC', true, 0, 0);
foreach($images as $i=>$image) {
// list($originalWidth, $originalHeight) = getimagesize($image->url);
// $ratio = (float)$originalWidth / $originalHeight;
// if($ratio > 1.2) {
// $class = "width-2";
// } else {
// $class = "";
// }
?>
<a class="fancybox" href="<?php echo $image->imageURL; ?>">
<div class="grid-item col-md-3 col-sm-6 col-xs-12">
<img src="<?php echo $image->thumbnailURL; ?>" />
<?php
if($image->_ngiw->_cache['description'] != "") {
?>
<div class="title">
<?php echo $image->_ngiw->_cache['description']; ?>
</div>
<?php
}
?>
</div>
</a>
<?php
}
?>
I just change post_name with post ID and its start working..
$images = $nggdb->get_gallery($post->ID, 'sortorder', 'ASC', true, 0, 0);
so here is correct code..
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.