Title: Repeatable image fields
Last modified: August 21, 2016

---

# Repeatable image fields

 *  [cokeyblokey](https://wordpress.org/support/users/cokeyblokey/)
 * (@cokeyblokey)
 * [13 years ago](https://wordpress.org/support/topic/repeatable-image-fields/)
 * Hi Par,
 * I’m trying to get repeatable image fields working. I have 4 repeatable fields–
   3x text, 1x image. I can get the text fields to display without issue, but the
   image just won’t display – the src is always blank.
 * Code i’m using is:
 *     ```
       <?php
       $repeatable_field_values = simple_fields_values("project_name,project_description,project_image,project_image_alt");
         foreach ($repeatable_field_values as $values) {
       $image_url = wp_get_attachment_image_src( $values );
         echo '<div class="grid_13 alpha omega">
       <div class="grid_10 alpha">
       <h3 class="green_li_subtitle">' . $values["project_name"] . '</h3>
       <div class="no_top_margin">' . $values["project_description"] . '</div>
       </div>
       <div class="grid3 alpha"><img src="' . $image_url . '"  alt="' . $values["project_image_alt"] . '" style="margin-bottom:5px;"></div>
       </div>';
       }
       ?>
       ```
   
 * As I said, the img src is always returned blank. The slug for the image is ‘project_image’.
 * I have seen another post (on your simple fields site) where you say:
 * > ah, you have all you need there
   >  this should do the trick: to output the url
   > to the image just write:
   > echo $values[“image”][“thumbnail”];
   > to output the thumnail version of the image
 * But I’m not really sure where this should go in my code – I’ve tried and tried
   and tried!
 * I’ve added var_dump($values); inside the loop and it displays all the possible
   images for each instance.
 * [http://wordpress.org/extend/plugins/simple-fields/](http://wordpress.org/extend/plugins/simple-fields/)

The topic ‘Repeatable image fields’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/simple-fields_fafafa.svg)
 * [Simple Fields](https://wordpress.org/plugins/simple-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-fields/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [cokeyblokey](https://wordpress.org/support/users/cokeyblokey/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/repeatable-image-fields/)
 * Status: not resolved