the following depends on if the function getCustomField()
returns or echoes the value of the custom field; it is based on the assumption/hope that the function will return the value – you could try:
<?php $value = getCustomField('tag-name'); ?>
<?php echo do_shortcode( ‘[slickr-flickr type=”slideshow” tag=”‘ . $value . ‘” size=”small”]’); ?>`
Thanks very much alchymyth…. You led me down the right track and I have now figured it out…
For anyone looking to do something similar, this is my code:
<?php $var = get_post_meta($post->ID, 'gallery-code', true);
if ($var == '')
{ }
else { echo do_shortcode( '[slickr-flickr type="slideshow" tag="' . $var . '" size="small"]'); } ?>
It checks to see if the custom field has a value and if so returns the custom field as the variable in the shortcode. If no custom field is entered is shows nothing… Works a treat!
@ciaranm Thanks Work like a charm ;c )
Ok, I did this with PWA+php / Picasa album. I posted here first because it wasn’t work (I had a type error in my code). I hope this helps someone else out too. 🙂
I’ve got the PWA+php plugin to pull in Picasa albums (which works via short code fine on the site). I wanted to pull images into a div within the footer div.
I want to pull the ‘pony’ album in on the ‘pony’ page by using the short code:
[pwaplusphp album="pony"]
Here is the code I’m using;
<div id="photogallery">
<?php $var = get_post_meta($post->ID, 'gallery-code', true);
if ($var == '')
{ }
else { echo do_shortcode( '[pwaplusphp album="' . $var . '"]'); } ?>
</div><!--photogallery-->
The custom field name: gallery-code
The custom field value: ‘pony’ (the album name from Picasa)
Ok, but I did find a glitch. The lightbox plugin doesn’t work when the images are in the footer. :-\