lochmc
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
Forum: Themes and Templates
In reply to: Need some help with a php if statementThanks 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
In reply to: [Magic Fields] [Plugin: Magic Fields] How to display all groupsFigured 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
In reply to: [Magic Fields] [Plugin: Magic Fields] How to display all groupsThanks, 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
In reply to: rotate pages content by days
Viewing 4 replies - 1 through 4 (of 4 total)