• I’m using Custom Field Template to create a simple multiple image upload using the Multiple Button feature. What I can’t figure out is how to get all the images to show! I can return a single file or image, but I am unsure how to call multiple files in. I assume it’s a “foreach” function, but I keep getting errors. Here is my code:

    <?php
     $Picture = get_post_meta($post->ID, 'Slide1', true);
     foreach($Picture as $Pictures) {
        echo wp_get_attachment_image($Picture, 'Slide1');
    	}
     ?>
     <?php endforeach; ?>

    Naturally, ‘Slide1’ is the name of the custom field that contains the multiple images.

    The error I get is:

    Parse error: syntax error, unexpected T_ENDFOREACH

    Not sure what I am missing here. Any help?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Custom Field Template] Multiple Button for Images…how to retrieve the images?’ is closed to new replies.