[Plugin: NextGEN Gallery] different slideshow for each page
-
I am trying to call a different slideshow depending which page is accessed in the header area of the page.
This is the code I have been working with:
if(is_page(‘home’)) { echo do_shortcode(‘[slideshow id=1 w=940 h=280]’); }
elseif(is_page(‘about’)) { echo do_shortcode(‘[slideshow id=2 w=940 h=280]’); }
elseif(is_page(‘safety’)) { echo do_shortcode(‘[slideshow id=3 w=940 h=280]’); }
elseif(is_page(‘sustainability’)) { echo do_shortcode(‘[slideshow id=4 w=940 h=280]’); }
elseif(is_page(‘services’)) { echo do_shortcode(‘[slideshow id=5 w=940 h=280]’); }
elseif(is_page(‘divisions’)) { echo do_shortcode(‘[slideshow id=6 w=940 h=280]’); }
elseif(is_page(‘investors’)) { echo do_shortcode(‘[slideshow id=7 w=940 h=280]’); }
elseif(is_page(‘careers’)) { echo do_shortcode(‘[slideshow id=8 w=940 h=280]’); }
elseif(is_page(‘media’)) { echo do_shortcode(‘[slideshow id=9 w=940 h=280]’); }
elseif(is_page(‘contact’)) { echo do_shortcode(‘[slideshow id=10 w=940 h=280]’); }but it only seems to be calling slideshow 1 for each page.
I can get it to work by making a template for each page with this code <?php echo do_shortcode(‘[slideshow id=4 w=940 h=280]’); ?> but I don’t think I should have to do it that way.
Can anyone see where I am going wrong with the code? I am relatively new to adapting php.
- The topic ‘[Plugin: NextGEN Gallery] different slideshow for each page’ is closed to new replies.