Home Forums Add-ons Repeater Field Repeater query is returning no content, any help is appreciated


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"); ?>
        <?php endif; ?>
          <?php the_sub_field("team_title"); ?>
      <div class="content-section-right left-line">
        <div class="content-entry fixed-left-align">
            <?php the_sub_field("team_about"); ?>
          <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>
                  <?php $title = the_sub_field('team_member'); ?>
                <p style="font-size: 12px;"><em>
                  <?php $job_title = the_sub_field('team_member'); ?>
                <?php endif; ?>
                <?php endwhile; ?>
                <?php endif; ?>
              <?php the_sub_field("team_more_text"); ?>
    <?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.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.