Home › Forums › Add-ons › Repeater Field › Display repeater array values › Reply To: Display repeater array values
I did replace ‘field_name’ but now everything disappeared, nothing at all is showing.
<main id="main" class="site-main" role="main">
<?php
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/content', 'page' );
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
endwhile; // End of the loop.
?>
<?php while( have_rows('person') ): the_row();
$image_url = get_sub_field('headshot');
$name = get_sub_field('name');
$credentials = get_sub_field('credentials');
$link = get_sub_field('link');
$expertise = get_field_object('expertise');
$value = $field['value'];
$choices = $field['choices'];
if( $value ):
?>
<div class="person">
<div class="col-sm-4 col-xs-12 text-center">
<div class="headshot-container">
<img src="<?php echo $image_url; ?>" alt="<?php echo $name; ?>" />
</div>
<div class="name">
<?php echo $name; ?>
</div>
<div class="credentials">
<?php echo $credentials; ?>
</div>
<div class="expertise">
Expertise:
<?php foreach( $value as $v ): ?>
<div><?php echo $choices[ $v ]; ?></div>
<?php endforeach; ?>
</div>
<a href="<?php echo $link; ?>" class="link">View Profile</a>
</div>
</div>
<?php endif; ?>
<?php endwhile; ?>
</main><!-- #main -->
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.