Title: Duplicate group returns image as Array
Last modified: August 20, 2016

---

# Duplicate group returns image as Array

 *  [iammathews](https://wordpress.org/support/users/iammathews/)
 * (@iammathews)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/duplicate-group-returns-image-as-array/)
 * Below is my code, everything else works fine except the image. It returns “Array”.
 *     ```
       $profiles = get_group('Teacher');
       		    foreach($profiles as $profile){
       		    	echo "<div class=\"side-er teacher fl-left\">";
       				echo "".$profile['teacher_image'][1]."";
       		    	echo "</div>";
       		    	echo "<div class=\"full-content fl-right\">";
       		    	echo "<h2>".$profile['teacher_full_name'][1]."</h2>";
       		    	echo "<p>".$profile['teacher_content'][1]."</p>";
       		    	echo "<p>Contact Details:<br />";
       		    	echo "Cell: ".$profile['teacher_cell'][1]."<br />";
       		    	echo "Email: <a href=\"".$profile['teacher_email'][1]."\">".$profile['teacher_email'][1]."</a></p>";
       		    	echo "</div>";
       		    	echo "<div class=\"clear-fix\"></div>";
       		    }
       ```
   
 * If I call `get('teacher_image');` The images shows but only the first groups 
   image on all groups.
 * Any suggestions?
 * [http://wordpress.org/extend/plugins/magic-fields/](http://wordpress.org/extend/plugins/magic-fields/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [iammathews](https://wordpress.org/support/users/iammathews/)
 * (@iammathews)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/duplicate-group-returns-image-as-array/#post-3475816)
 * Okay so I found the answer. After `$profiles = get_group('Teacher');` insert `
   pr($profiles);`. It will then return a whole bunch of code and feed you back 
   with “pre” text. It then shows you the array of types for your image. You then
   select which ever one and insert it into your code. Remeber to remove the `pr(
   $profiles)`
 * Below is a snippet of the complete working code:
 *     ```
       $profiles = get_group('Teacher');
       		    foreach($profiles as $profile){
       		    	echo "<div class=\"side-er teacher fl-left\">";
       		    	echo "".$profile['teacher_image'][1]['src']."";
       		    	echo "</div>";
       		    	echo "<div class=\"full-content fl-right\">";
       		    	echo "<h2>".$profile['teacher_full_name'][1]."</h2>";
       		    	echo "<p>".$profile['teacher_content'][1]."</p>";
       		    	echo "<p>Contact Details:<br />";
       		    	echo "Cell: ".$profile['teacher_cell'][1]."<br />";
       		    	echo "Email: <a href=\"".$profile['teacher_email'][1]."\">".$profile['teacher_email'][1]."</a></p>";
       		    	echo "</div>";
       		    	echo "<div class=\"clear-fix\"></div>";
       		    }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Duplicate group returns image as Array’ is closed to new replies.

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

## Tags

 * [array](https://wordpress.org/support/topic-tag/array/)
 * [duplicates](https://wordpress.org/support/topic-tag/duplicates/)
 * [group](https://wordpress.org/support/topic-tag/group/)
 * [images](https://wordpress.org/support/topic-tag/images/)

 * 1 reply
 * 1 participant
 * Last reply from: [iammathews](https://wordpress.org/support/users/iammathews/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/duplicate-group-returns-image-as-array/#post-3475816)
 * Status: not resolved