I have a salon website with a gallery page wherein the user must first select a stylist prior to viewing their individual gallery.

I planned on using NextGen to house the images in stylist specific galleries, and using the NextGen shortcodes(ex: [nggallery id=1]) to determine which gallery gets shown on the specific page.

After doing a bit of research, I think WP's conditional tags (I'm thinking is_page( # )) might be the best route to take for this, I'm just not sure how to integrate the conditional tags to specify/define the page and the NextGen shortcodes.

Any tips, help, advice, etc. is greatly appreciated.

1 Answer 1


I am not sure to understand your question, but you have to read more wordpress/nextgen documentation.

What you need to do exactly? Can you be more specific?

I think, that if you create a set of pages (for each stylist) and use the respective shortcode of the gallery in the content, this will work fine.

ex: in the page REBECCA HAEHNLE (page_id=29) use [nggallery id=ref_stylist_galery]

On the mother page (gallery), use the album shortcode (create an album with all the stylists galleries in order you want) [album id=ref_album_id template=extend]

I think it will do the trick :)

In other words, you can do something like this in your page.php template:

if( is_page(ID_OF_SPECIFIC_PAGE) ) {
  // make your stuff here
  echo do_shortcode('[nggallery id='.$my_id.']');
} else {
  // output standard content here
  • Thank you for your help. In gallery.php I have inserted the following: <div class="gallery"> <?php if( is_page( 29 ) ) { // make your stuff here echo do_shortcode('[nggallery id='1']'); } else { // output standard content here } <?php endif; ?> </div><!-- end gallery --> In WP Page content field I have [nggallery id=1]. Making those changes has lead to a completely white page. Any ideas what's going on? Aug 22, 2012 at 19:45
  • in config.php in wordpress root: change to define('WP_DEBUG', true); and you will now see php error output on screen. :) Aug 22, 2012 at 20:15
  • the template in your theme: /nggallery/gallery.php is to output HTML markup... and if you put allready the shortcode in your post, you don´t need call it again. he is allready in page(29) Aug 22, 2012 at 20:25
  • oh, debugging. There was an unnecessary endif in the php. Thank you for your help! Aug 23, 2012 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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