Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Josh Leuze

    (@jleuze)

    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.

    Thread Starter Dan Stramer

    (@danstramer)

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

    Plugin Author Josh Leuze

    (@jleuze)

    Good to hear you got it working Dan!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Use variable in template tag’ is closed to new replies.