Print values
Loop over a repeater
<ul>
<?php foreach ( ugly_rows( 'team' ) as $person ) : ?>
<li>
<?php $person->show( 'name' ); ?>
<?php if ( $person->has( 'role' ) ) : ?>
<em><?php $person->show( 'role' ); ?></em>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>ugly_rows() always gives a list, empty when there is nothing, so no if is needed around the loop. A row is a variable: pass it to get_template_part( 'parts/person', null, array( 'person' => $person ) ).
Did this article answer your question?
Thank you. It helps us make the documentation better. Need more help?