Title: lochmc's Replies | WordPress.org

---

# lochmc

  [  ](https://wordpress.org/support/users/lochmc/)

 *   [Profile](https://wordpress.org/support/users/lochmc/)
 *   [Topics Started](https://wordpress.org/support/users/lochmc/topics/)
 *   [Replies Created](https://wordpress.org/support/users/lochmc/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/lochmc/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/lochmc/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/lochmc/engagements/)
 *   [Favorites](https://wordpress.org/support/users/lochmc/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Need some help with a php if statement](https://wordpress.org/support/topic/need-some-help-with-a-php-if-statement/)
 *  Thread Starter [lochmc](https://wordpress.org/support/users/lochmc/)
 * (@lochmc)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/need-some-help-with-a-php-if-statement/#post-1952826)
 * Thanks for the help, JPry. Perfect! Although you mispelt wp_get_attachment_image__scr_
   🙂
 * Just pasting final code in case anyone else ever needs to use this.
 *     ```
       <?php
       $headerAttributes = "";
       if ( has_post_thumbnail( $post->ID ) ) {
       	$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
       	$headerAttributes = $headerAttributes . " " . 'style="background-image: url(' . $image[0] . ')"';
       }
       if ( is_front_page() || is_home() ) {
       	$headerAttributes = $headerAttributes . ' class="slide"';
       }
       echo '<div id="header"' . $headerAttributes . '>';
       ?>
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Magic Fields] [Plugin: Magic Fields] How to display all groups](https://wordpress.org/support/topic/plugin-magic-fields-how-to-display-all-groups/)
 *  [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 } ?>
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Magic Fields] [Plugin: Magic Fields] How to display all groups](https://wordpress.org/support/topic/plugin-magic-fields-how-to-display-all-groups/)
 *  [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”.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [rotate pages content by days](https://wordpress.org/support/topic/rotate-pages-content-by-days/)
 *  [lochmc](https://wordpress.org/support/users/lochmc/)
 * (@lochmc)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/rotate-pages-content-by-days/#post-1687009)
 * This might help: [http://wordpress.org/support/topic/display-different-page-on-front-page-based-on-day-of-the-week](http://wordpress.org/support/topic/display-different-page-on-front-page-based-on-day-of-the-week)

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