繁体   English   中英

Nexgen Gallery Wordpress不显示图像

[英]Nexgen gallery wordpress not showing images

我已经更新了Nexgen gallery插件,它停止在通过自定义PHP代码获取的页面上显示图库。

这是我用来获取图库的代码。

$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
}

?>

我只是用post ID更改post_name并开始工作。

$images = $nggdb->get_gallery($post->ID, 'sortorder', 'ASC', true, 0, 0);

所以这里是正确的代码。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM