Support

Account

Home Forums Add-ons Repeater Field Sort repeater by ID

Helping

Sort repeater by ID

  • Hello,

    I’m completely lost at how to sort my repeater field by ID. I did check the docs but was still unsure of where/how to set up the order.

    <?php $i = 1;   ?>
              <div class="row">
    
                <?php while ( have_rows('individual_case', 24) ): the_row(); ?>
                  <div class="col-md-4 row-eq-height">
     <div class="result-box">
    	<h4 class="result-type"> </h4>
    	<h3 class="result-amount"><?php the_sub_field('case_amount'); ?></h3>
    <hr class="result-line">
    	<p><?php the_sub_field('case_description'); ?></p>
    </div>
    </div>
    
                  <?php
                    if( $i == 3 ){
                      echo '</div><div class="row">';
                      $i == 0; 
                    }
                    $i++;
        if ($i > 6) {
          break;
        }
                  ?>
                <?php endwhile; ?>
              </div>
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.