Retrieving images from a NextGEN gallery

I’m not sure if this is possible but after extensive searching I can’t find an answer.

What I want to do is to get all images from a NextGEN gallery so I can display them in a custom slideshow within a page/post.

Read More

Is it possible to load them into an array or edit the HTML in some way?

Any help is greatly appreciated!

Related posts

Leave a Reply

2 comments

  1. For anyone interested I found a solution to what I wanted.

    You simply need to create a custom template

    Then I accessed the images like this:

    <?php foreach ($images as $image) : ?>
    <?php echo do_shortcode('[singlepic id="' . $image->pid . '"]'); ?>
    <?php endforeach; ?>
    
  2. A quick and dirty way would be to use $wpdb to get them from the wp_ngg_pictures table and the shortcode for a single image.

    If you know the gallery id then something like: (untested)

    global $wpdb;
    
    $pictures = $wpdb->get_results("SELECT * FROM wp_ngg_pictures WHERE galleryid = '[id]'");
    
    foreach( $pictures as $p ) {
        echo do_shortcode("[ singlepic id=".$p->pid." ]");
    }
    

    singlepic shortcode