You would probably be better off using a custom field to store the id of the album and then calling that (less code too ?? ). Mostly because currently I don’t think NextGen has a way to call a gallery by name built into it.
So say we add a custom field to the page called meta_gallery_id
and then make the value the id of your album. Then when you want to call that in the template you would do it like so:
<?php
$meta_id = $wp_query->post->ID; /* stores your post id in a variable */
/* This stores the defined gallery ID into a variable. Setting this to true makes sure it returns a string instead of an array */
$meta_gallery_id = get_post_meta( $meta_id, 'meta_gallery_id', true );
if( $meta_gallery_id != '' ) {
$meta_gallery = '[gallery=' . $meta_gallery_id . ']';
$meta_gallery= apply_filters( 'the_content', $meta_gallery );
echo $meta_gallery;
}
?>
I’ve tested this on my sandbox site and it works as far as I can tell. Let me know how it works for you. ??