Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.