Top

Wargazm on "[Plugin: NextGEN Gallery] Getting image from Page template"

June 2, 2010 by  

hopefully this is a quick and easy question to answer.

I am creating a Page template in PHP, and I’d like to that template to be able to read a custom field containing an ID for an image in the nextgen gallery.

an example:
If I had a field called pic_id, and that pic_id was 20, I’d like to be able to do something like this:

<?php $pic_id = get_post_meta($page_id, 'pic_id', true); ?>
[singlepic id=<?php echo $pic_id; ?> w=200 h=200 float=none]

However, that just shows the text
[singlepic id=20 w=320 h=240 float=none]
on the page, since PHP doesn’t parse the shortcode.

Is it possible to accomplish this?

Thanks in advance.

http://wordpress.org/extend/plugins/nextgen-gallery/

Be Sociable, Share!
Share

Comments

Facebook comments:

Feel free to leave a comment...
and oh, if you want a pic to show with your comment, go get a gravatar!





*
Bottom