boykodev

WordPress

May 23rd, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. <?php
  2.  
  3. // check if the repeater field has rows of data
  4. if( have_rows('outer_repeater_field_name') ):
  5.  
  6.     // loop through the rows of data
  7.     while ( have_rows('outer_repeater_field_name') ) : the_row();
  8.  
  9.  
  10.     // check if the repeater field has rows of data
  11.         if( have_rows('inner_repeater_field_name') ):
  12.  
  13.             // loop through the rows of data
  14.             while ( have_rows('inner_repeater_field_name') ) : the_row();
  15.                
  16.                 // ТУТ ТИ ПОЛУЧАЕШЬ ДОСТУП К ПОЛЮ
  17.                 the_sub_field('sub_field_name');
  18.  
  19.             endwhile;
  20.  
  21.         else :
  22.  
  23.             // no rows found
  24.  
  25.         endif;
  26.  
  27.     endwhile;
  28.  
  29. else :
  30.  
  31.     // no rows found
  32.  
  33. endif;
Advertisement
Add Comment
Please, Sign In to add comment