【发布时间】:2016-06-15 19:26:05
【问题描述】:
我想在 NextGen 中循环浏览特定专辑的图像。
我想使用 NextGen 专辑在主题 header.php 中创建横幅幻灯片。比如:
loop through images in album = x:
$src = src of image
$title = title of image
echo $src and $title
如何做到这一点?
找到了解决方案:
global $nggdb;
$gallery = $nggdb->get_gallery(8, 'sortorder', 'ASC', true, 0, 0);
foreach($gallery as $image) {
echo $image->imageURL;
echo $image->alttext;
echo $image->description;
}
所有其他 $image 属性也可以打印
【问题讨论】:
-
请添加解决方案作为答案,这样这个问题就不会挂在“未回答”类别中。
-
我一直在为 nextGen 寻找一些不错的在线文档。我已经通过 doxygen 运行了源代码,这有帮助,但没有找到有效的示例。谁有链接?