Search code examples
mysqlwordpressnextgen-gallery

Show All Images of NextGEN Gallery from Multiple Gallery ID


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...


Solution

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