Support

Account

Home Forums Add-ons Repeater Field Repeater field doesn't work with Flexslider Reply To: Repeater field doesn't work with Flexslider

  • Hi James. I apologize for asking too much questions. I’m still not very familiar with PHP and just took a course about ACF.

    I have tried to do this with Custom Post Type UI and this time it’s for the team section: http://tympanus.net/Freebies/HalcyonDaysTemplate/#

    I did the same thing just like the last code you posted but there’s an extra slide with empty content. What am I missing?

    <div id="teamSlider">
      <ul class="slides">
          <?php $team = new WP_Query( array(
              'post_type'     => 'team',
              'orderby'       => 'post_id',
              'order'         => 'ASC'
          )); ?>
          <?php
            $li = 0;
            $max_li = count($team);
          ?>
          <li>
          <?php while($team->have_posts()) : $team->the_post(); $li++; ?>
          <div class="col-md-4 wp5">
            <?php if(has_post_thumbnail()) {
                the_post_thumbnail();
            } ?>
            <h2><?php the_title(); ?></h2>
            <p><?php the_content(); ?></p>
            <div class="social">
              <ul class="social-buttons">
                <?php if(get_field('social_account')) : while(has_sub_field('social_account')) : ?>
                <li>
                    <a href="<?php the_sub_field('team_social_link'); ?>" class="social-btn">
                        <?php the_sub_field('team_social_icon'); ?>
                    </a>
                </li>
                <?php endwhile; endif; ?>
              </ul>
            </div> <!-- END .social -->
          </div> <!-- END .col-md-4 .wp5 -->
    
          <?php if($li % 3 == 0 && $li != $max_li) { ?>
          </li><li>
          <?php } ?>
        <?php endwhile; ?>
        </li>
    </ul> <!-- END .slides -->
    </div> <!-- END #teamSlider -->