WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: NextGEN Gallery] Nggallery hack - simple PHP question for the experts! (2 posts)

  1. bolide
    Member
    Posted 2 years ago #

    I am using a theme called Portfolium. I want to display an NGgallery slideshow in a portfolio page

    I have got as far as calling a Custom field (NGgallery id) but don't know the syntax to parse the result correctly in single-portfolio.php which is the PHP that renders the portfolio page

    Simple stuff for you PHP experts:

    1 - do the [slideshow= bit - <?php include do_shortcode('[slideshow id='); ?>
    2 - pull out the gallery id - <?php $key="--nggalleryid"; echo get_post_meta($post->ID, $key, true); ?>
    3 - put the end on the slideshow tag - <?php include ' w=785 h=521]'; ?>

    I don't know if include is the right code and I can't get the string to parse properly & work. It's a syntax thing

    the last thing I tried was this:

    <?php include do_shortcode('[slideshow id=' $key="--nggalleryid"); echo get_post_meta($post->ID, $key, true); echo ' w=785 h=521]'; ?>

    I used this as the custom field name: --nggalleryid

    Help!

  2. bolide
    Member
    Posted 2 years ago #

    OK, this PHP outputs the gallery code but doesn't parse it to show the gallery

    <?php echo'[slideshow id='; $key="--nggalleryid"; echo get_post_meta($post->ID, $key, true); echo ' w=785 h=521]'; ?>

    This outputs [slideshow id=1 w=785 h=521] - that code, in a page or post, brings up a NGG gallery but my code is showing the shortcode, not parsing it

Topic Closed

This topic has been closed to new replies.

About this Topic