【问题标题】:Show All Images of NextGEN Gallery from Multiple Gallery ID显示来自多个图库 ID 的 NextGEN Gallery 的所有图像
【发布时间】:2014-02-08 20:28:59
【问题描述】:

以下代码是显示来自特定画廊 ID 的所有图像的方法,它有效!

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

但我想要显示来自多个专辑 ID 的所有图像?任何人都可以帮助我吗?请...

【问题讨论】:

    标签: mysql wordpress nextgen-gallery


    【解决方案1】:

    试试这个

    global $nggdb;
    foreach($ids as $id) {
    $gallery = $nggdb->get_gallery($id, 'sortorder', 'ASC', true, 0, 0);
            foreach($gallery as $image) {
                echo $image->imageURL;
                echo $image->alttext;
                echo $image->description;
             }
     }
    

    【讨论】:

    • 对我来说“$image->imageURL”是空的,我不知道为什么!
    猜你喜欢
    • 2014-07-20
    • 1970-01-01
    • 2014-11-20
    • 1970-01-01
    • 1970-01-01
    • 2012-11-05
    • 2015-05-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多