Title: [Plugin: Magic Fields] How to display all groups
Last modified: August 19, 2016

---

# [Plugin: Magic Fields] How to display all groups

 *  [polyfade](https://wordpress.org/support/users/polyfade/)
 * (@polyfade)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-magic-fields-how-to-display-all-groups/)
 * Would someone please assist? I’m not the most fluent PHP person. I first looked
   at the Magic Fields wiki and I still can’t figure out my problem.
    Simply put,
   I added a post to a category ‘Fave’ which I set up using Magic Fields. Inside
   I created 3 groups of information that I want to show. I can get one group to
   display successfully, but the others won’t print out. I’m guessing I have to 
   use ‘for each’ statement, but how? My code so far is shown below:
 *     ```
       <h2><?php echo get('fave_detail_title'); ?></h2>
       <?php echo get('fave_detail_image'); ?>
       <?php echo get('fave_detail_summary'); ?>
       <p><?php echo get('fave_detail_location'); ?></p>
       <p><a href="http://<?php echo get('fave_detail_link'); ?>">View this</a></p>
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [polyfade](https://wordpress.org/support/users/polyfade/)
 * (@polyfade)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-magic-fields-how-to-display-all-groups/#post-1893829)
 * sorry, just too much fatigue.
    i started fresh and got it to work. this tutorial
   is a bit more comprehensive: [http://www.doc4design.com/articles/magic-fields-duplicates/](http://www.doc4design.com/articles/magic-fields-duplicates/)
 * as noted, the english translation of magic fields wiki is not completely translated
   so it could be difficult to understand especially under tired vision.
 * this is a fantastic plugin!
 *  [lochmc](https://wordpress.org/support/users/lochmc/)
 * (@lochmc)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-magic-fields-how-to-display-all-groups/#post-1894091)
 * Thanks, I came looking for exactly this solution.
 * Although, I have a duplicate field that has a series of checkboxes and it only
   outputs as “Array”. Not sure how to make it output.
 *     ```
       <?php $myEvent = get_group('class');
       		  foreach($myEvent as $event){ ?>
       		  <div class="row">
       			  <span class="class_time"><?php echo $event['class_time'][1]; ?></span>
       			  <span class="class_name"><?php echo $event['class_name'][1]; ?></span>
       			  <span class="class_location"><?php echo $event['class_location'][1]; ?></span>
       		  </div>
       		<?php } ?>
       ```
   
 * That’s what I’m using, **class_location** just shows as “Array”.
 *  [lochmc](https://wordpress.org/support/users/lochmc/)
 * (@lochmc)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-magic-fields-how-to-display-all-groups/#post-1894097)
 * Figured it out. Just put another foreach in for the class_location
 *     ```
       <?php $mytitle = $event['class_location'][1];
       			foreach($mytitle as $title){ ?>
       			<span class="class_location"><?php echo $title; ?></span>
   
       		<?php } ?>
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: Magic Fields] How to display all groups’ 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/)

 * 3 replies
 * 2 participants
 * Last reply from: [lochmc](https://wordpress.org/support/users/lochmc/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-magic-fields-how-to-display-all-groups/#post-1894097)
 * Status: not resolved