문제

The following code is the way to display all images from specific gallery ID and it works!

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

but what I want is to show all images from multiple album ID? anyone can help me? please...

도움이 되었습니까?

해결책

Try this

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;
         }
 }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top