2

I'm using the popular NextGen Gallery / nggallery plugin to handle photo albums and galleries on my site.

I can arrange photos into a album and display it using a shortcode no problem, where I'm struggling is that I want to create a master "Photo Galleries" page which will show all of the photo Albums on the site.

Any advice / ideas on how to do this? The only vaguely useful suggestion I've found online thus far is to re-arrange the albums so that I have a master albums which has everything else as a sub albums. This feels very suboptimal as each gallery / albums will need to be re-arranged on upload.

I found a duplicate of this question elsewhere on the stack network - https://webmasters.stackexchange.com/questions/1858/how-to-show-all-albums-in-wordpress-nextgen-gallery but that one doesn't have an answer and hasn't been migrated to here.

Thanks Jona

closed as off-topic by Mark Kaplun, birgire, Pieter Goosen, gmazzap, Johannes Pille Sep 28 '14 at 12:35

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic." – Mark Kaplun, birgire, Pieter Goosen, gmazzap, Johannes Pille
If this question can be reworded to fit the rules in the help center, please edit the question.

4
+25

I have not a ready solution, but small hints.

You get all albums from nggallery with a small sql select. This get a array with all data to the album. If you have the right fields, change the * and use only the fields, there store your data.

    global $wpdb; 
    $albumlist = $wpdb->get_results("SELECT * FROM $wpdb->nggalbum ORDER BY id");

After this result you can create in a template a list with this data, like the name as example.

    foreach( $albumlist as $album ) {
        echo '<b>ID: ' . $album->id . ' Name: ' . $album->name . '</b><br>';
    }

Before you play with a sql select please play woth the global var and the functions of nextgen. The important var of ngg is $nggdb. About this you can use many methods to the class of ngg, lik get_used_galleries().

I know about this method. Please check the example source.

global $nggdb;
$galleries = array();
/* find all galleries */
foreach( $nggdb->find_all_galleries() as $gallery ) {
   // check the array $gallery
   // $gallery: name, path(wp-content), title, previewpicID, author
   array_push( $galleries, $gallery->gid );
}
/* create a temporary album with all galleries */
echo nggCreateAlbum( $galleries, 'grid' );

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