Hi Dan, sure you can do this. Here’s an example that checks for a custom field called “slideshow_slug”, if the the post or page has a value for that custom field it loads a slideshow with that slug:
<?php // Load slideshow if post has a custom field for the slideshow slug
if ( get_post_meta( $post->ID, "slideshow_slug", $single = true ) != "" ) {
$meteor_slug = get_post_meta( $post->ID, "slideshow_slug", $single = true );
if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow( $meteor_slug, "width:718, height:356" ); }
} ?>
Notice that when you use a PHP variable you don’t need to use quotes around it in the meteor_slideshow function.
Thanks Josh!
I also got it working like so (I am using the afc plug in):
<?php $slideshow = get_field('slideshow'); ?>
<div class="slideshow-project">
<?php if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow($slideshow, "width:718, height:356"); } ?>
Good to hear you got it working Dan!