Home › Forums › Add-ons › Repeater Field › Repeater query is returning no content, any help is appreciated
The following is a flexible content area that has 4 ACF fields. It has a title, sub_title, team_sub_title, team_more_text, and then the repeater team_members / team_member. When I pull the repeater field code the sub fields return, but there is something with my query on the repeater that is not working well.
Any help looking it over is greatly appreciated!
<?php if( get_row_layout() == 'team_section' ): ?>
<div class="two-column">
<div class="inner">
<div class="inner-min">
<div class="content-section-head">
<?php if(get_sub_field("team_sub_title")) : ?>
<div class="sub-title">
<?php the_sub_field("team_sub_title"); ?>
</div>
<?php endif; ?>
<h2>
<?php the_sub_field("team_title"); ?>
</h2>
</div>
<div class="content-section-right left-line">
<div class="content-entry fixed-left-align">
<p>
<?php the_sub_field("team_about"); ?>
</p>
<div class="team-list">
<div class="team-list-inner">
<?php if( have_rows('team_members') ): ?>
<?php while ( have_rows('team_members') ) : the_row(); ?>
<?php if( get_row_layout() == 'team_member' ): ?>
<div class="staff-list-item-image">
<?php $image = the_sub_field('team_member'); ?>
<div class="staff-image" style="background: #ffffff url(<?php echo $image[0]; ?>) no-repeat center top / cover;"></div>
<p><a>">
<?php $title = the_sub_field('team_member'); ?>
</a></p>
<p style="font-size: 12px;"><em>
<?php $job_title = the_sub_field('team_member'); ?>
</em></p>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>
<p>
<?php the_sub_field("team_more_text"); ?>
</p>
</div>
</div>
</div>
</div>
<?php endif; ?>
If team_members is a repeater then this
if( get_row_layout() == 'team_member' ):
is false. Repeaters do not have row layouts, that is only for flex fields.
You must be logged in to reply to this topic.
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.