Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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.