WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

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

Any help is greatly appreciated!

share|improve this question
up vote 2 down vote accepted

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; ?>
share|improve this answer

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

share|improve this answer
Thanks for the reply. I have tried implementing your code but unfortunately it doesn't display anything. Am I correct in thinking that I just needed to replace the [id] with the gallery id (e.g. 1) ? – Tim Oct 17 '11 at 12:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.