Skip to content
Custom fields for WordPress that are quick to build and quick to load. Get Pro

Content on the page

A team list

A repeater of people: name, role, photo and bio, printed as cards.

1 minute Works with the free plugin

The team list on the site
The team list on the site.

Fields. team (Repeater): name (Text), role (Text), photo (Image, ID), bio (Text area).

PHP
<div class="team">
	<?php foreach ( ugly_rows( 'team' ) as $member ) : ?>
		<article class="team__member">
			<?php echo wp_get_attachment_image( $member->get( 'photo' ), 'thumbnail' ); ?>
			<h3><?php $member->show( 'name' ); ?></h3>
			<p class="team__role"><?php $member->show( 'role' ); ?></p>

			<?php if ( $member->has( 'bio' ) ) : ?>
				<p><?php $member->show( 'bio' ); ?></p>
			<?php endif; ?>
		</article>
	<?php endforeach; ?>
</div>

No if around the loop: an empty repeater is an empty list.