WordPress.org

Support

Support » Plugins and Hacks » Nextgen Gallery do_shortcode not working?

Nextgen Gallery do_shortcode not working?

  • 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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • That’s a syntax error, what do you have on line 18?

    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]”); ?>

    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); ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Nextgen Gallery do_shortcode not working?’ is closed to new replies.
Skip to toolbar