WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: NextGEN Gallery] different slideshow per page in the header (4 posts)

  1. mrel
    Member
    Posted 4 years ago #

    Goal: each page (not post) has a slideshow with a different gallery.

    Conditions: the slideshow shall be located in header.php

    Solution: missing.

    Any ideas?

  2. Tim Griffin
    Member
    Posted 4 years ago #

    Yes - you need to utilize conditional tags.

    See this codex article - check out snippet 3 for some good hints.

  3. Shoshin
    Member
    Posted 4 years ago #

    I did something like this, to have a different slideshow per page:

    <?php if (is_page('4')  || $post->post_parent == '4' ) : ?>
             <?php if (function_exists("nggSlideshowWidget"))
               {nggSlideshowWidget($galleryID=2,$Width=390,$Height=260); }
    
    <?php elseif (is_page('5') || $post->post_parent == '5'  ): ?>
             <?php if (function_exists("nggSlideshowWidget"))
               {nggSlideshowWidget($galleryID=3,$Width=390,$Height=260); }
             ?>
    
    <?php endif ?>

    But NGG Slideshow just sits there showing the loading icon forever...
    Anyone know what's wrong? Some syntax problem with nested if's?

    PS: Galleries exists, and images inside galleries present

  4. Shoshin
    Member
    Posted 4 years ago #

    ...Nevermind, just solved it myself:

    <?php if (is_page('4')  || $post->post_parent == '4' ) : ?>
                   <?php if (function_exists("nggSlideshowWidget"))
                nggSlideshowWidget($galleryID=2,$Width=390,$Height=260); ?>
    
    <?php elseif (is_page('5') || $post->post_parent == '5'  ): ?>
                   <?php if (function_exists("nggSlideshowWidget"))
                nggSlideshowWidget($galleryID=3,$Width=390,$Height=260); ?>
    <?php endif; ?>

    It's always that last thing you try.

Topic Closed

This topic has been closed to new replies.

About this Topic