I am using a foreach loop to generate a set of thumbnail links. I am using Wordpress and for one reason or another the place my PHP is executing is not the place I would like to render the list. So my question is: can I replace the echo statement with something that will store all of the generated html (for each image, not just the last one) and allow me to generate it further down the same page?
Thanks for any help. Here's my php so far:
foreach ($gallery_images as $galleryID) {
$attachment = get_post( $galleryID );
$thumb_img = wp_get_attachment_image_src( $galleryID, 'thumbnail' ); //thumbnail src
$full_img = wp_get_attachment_image_src( $galleryID, 'full' ); //full img src
echo '<a href="' . $full_img[0] . '" id="description-button-' . $gallery_images_count . '" class="thumbLink" target="_blank"><img src="' . $thumb_img[0] .'"></a>';
$gallery_images_count++;
}//end forEach