WordPress.org

Ready to get started?Download WordPress

Forums

Nextgen Gallery do_shortcode not working? (4 posts)

  1. aminalcwakerz
    Member
    Posted 4 years ago #

    I'm trying to add the nextgen gallery to my home page using this code:

    <?php echo do_shortcode(‘[slideshow id=1 w=475 h=390]‘); ?>

    However, upon adding that to my index.php, I receive the error:

    Parse error: syntax error, unexpected '[' in /home2/toricola/public_html/wp-content/themes/optimize/index.php on line 18

    It seems as though it doesn't recognize the short code.
    How do I make this work? Thanks.

  2. pealo86
    Member
    Posted 3 years ago #

    That's a syntax error, what do you have on line 18?

  3. Lynn
    Member
    Posted 3 years ago #

    I wonder if it is the single quotes in

    <?php echo do_shortcode(‘[slideshow id=1 w=475 h=390]‘); ?>

    The following is working just fine for me:

    <?php echo do_shortcode("[slideshow id=8 template=galleryview images=0]"); ?>

  4. bhamrick
    Member
    Posted 3 years ago #

    do_shortcode seems inefficient here, as ultimately the shortcode is calling the nextgen function echo nggShowSlideshow();

    I would just do this:
    <?php echo nggShowSlideshow(1, 475, 390); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic