• I have added the following code to my front page in order to display a nextgen slide show. Here is the code i added:

    ‘ <?php
    $gallery_id = get_post_meta( $post->ID, ‘gallery_id’, true); // Get gallery id from custom field data
    if( isset($gallery_id) ){
    echo “<div class=\”post-gallery\”>”;
    echo nggShowGallery( $gallery_id=4 ); // Display the gallery
    echo “</div>”;
    }
    ?> ‘

    What I end up with is thumbnails of all the photos, and above it a link that says ‘show slideshow.’ But I want the slide show itself. Also, if I click on the link I get another page entirely!
    Can someone help me? Thanks!

    https://www.ads-software.com/extend/plugins/nextgen-gallery/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Instead of nggShowGallery use nggShowSlideshow:
    <?php echo nggShowSlideshow(ID,width,height); ?>

    Thread Starter Patsy O

    (@patsy-o)

    I’m not sure what code to substitute for what. Below is how I rewrote the code, and I did and ended up with a message: “Parse error: syntax error, unexpected ‘<‘ in /home/nemc/public_html/wp-content/themes/colorway/front-page.php on line 23”
    (this is the line with your code in it) Help! thanks for responding!

    <?php
    $slideshow_id = get_post_meta( $post->ID, 'slideshow_id', true); // Get slideshow id from custom field data
    if( isset($slideshow_id) ){
    echo "<div class=\"post-slideshow\">";
    <?php echo nggShowSlideshow(ID=4 W=450 H=350); ?>
    // Display the slideshow
    echo "</div>";
    }
    ?>

    You don’t need the <?php and ?> before and after the echo nggShowSlideshow, since you already have the opening and closing tag. Only use this part: echo nggShowSlideshow(ID,width,height);

    For the parameters write only the variables or numbers, like this: echo nggShowSlideshow(4,450,350);

    So the full code should look like this:

    <?php
    $slideshow_id = get_post_meta( $post->ID, 'slideshow_id', true); // Get slideshow id from custom field data
    if( isset($slideshow_id) ){
    echo "<div class=\"post-gallery\">";
    echo nggShowSlideshow(4,450,350); // Display the slideshow
    echo "</div>";
    }
    ?>
    Thread Starter Patsy O

    (@patsy-o)

    This worked!!!! Yea! A thousand thanks. I have no idea what I am doing and am truly punting. Without your help I would have gotten no where. I greatly appreciate it.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: NextGEN Gallery] Add nextgengallery slideshow to homepage’ is closed to new replies.