Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save farinspace/1186752 to your computer and use it in GitHub Desktop.
Save farinspace/1186752 to your computer and use it in GitHub Desktop.
sample output
<?php
global $testimonial_metabox;
$testimonial_bg = $testimonial_metabox->get_the_value( 'background' );
$testimonials = $testimonial_metabox->get_the_value( 'testimonials' );
?>
<?php foreach ($testimonials as $testimonial) { ?>
<div class="<?php echo $testimonial_bg; ?>">
<?php echo wpautop( $testimonial['content'] ); ?>
<?php echo $testimonial['name']; ?><br/>
<?php echo $testimonial['audio']; ?>
</div>
<?php } ?>
<!-- OR -->
<?php
global $testimonial_metabox;
$testimonial_bg = $testimonial_metabox->get_the_value( 'background' );
while( $testimonial_metabox->have_fields( 'testimonials' ) )
{
echo '<div class="' . $testimonial_bg . '">';
echo wpautop( $testimonial_metabox->get_the_value( 'content' ) );
echo $testimonial_metabox->the_value( 'name' );
echo '<br/>';
echo $testimonial_metabox->the_value( 'audio' );
echo '</div>';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment