Repeater w repeater’ze

<?php if(have_rows('package')): ?>
  <?php while(have_rows('package')): the_row();?> 
    <div class="box-package">
        <div class="des-head">
          <div class="single-cell"><?php the_sub_field('name'); ?></div>
        </div>
        
        <!-- picture cell -->
        <div class="cell-img">
          <?php $image = get_sub_field('img'); ?>
          <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
        </div><!-- //picture cell -->
  
  <!-- repeater option -->
  <?php if(have_rows('options')): ?>
      <section class="single-box">      
    <?php while(have_rows('options')): the_row();?> 
        <div class="single-des">
          <div class="single-cell">
            <?php the_sub_field('option'); ?>
          </div>
        </div>
    <?php endwhile; ?> 
      </section>  
  <?php endif; ?><!-- //repeater option -->
        
        <!-- price -->
        <div class="end-des">
          <div class="single-cell">
            <?php the_sub_field('price'); ?><br />
            <span><?php the_sub_field('price-description'); ?></span>
          </div>
        </div><!-- //price -->
    </div>		
  <?php endwhile; ?> 
<?php endif; ?>

#Wordpress

Agnieszka Trefler

Agnieszka Trefler (Ruda) - freelancer, web developer, specjalistka od WordPressa z Wrocławia. Z pasją budowania stron, blogowania i fotografowania. Twórca Inspiracji fotograficznych.