Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NateJLewis/7486ad497d50558d0c5076c616d2bfbe to your computer and use it in GitHub Desktop.
Save NateJLewis/7486ad497d50558d0c5076c616d2bfbe to your computer and use it in GitHub Desktop.
<?php
// CHECK IF REPEATER EXISTS
if( have_rows('repeater_field_name') ):
// REPEATER LOOP
while ( have_rows('repeater_field_name') ) : the_row();
// ANY SUBFIELDS NOT IN THE FLEXIBLE CONTENT (IE THE HEADING)
// CHECK IF FLEXIBLE CONTENT EXISTS
if( have_rows('flexible_content_field_name') ):
// FLEXIBLE CONTENT LOOP
while ( have_rows('flexible_content_field_name') ) : the_row();
if( get_row_layout() == 'text' ):
// IMAGE
elseif( get_row_layout() == 'SOMETHING' ):
// SOMETHING
elseif( get_row_layout() == 'image' ):
// TEXT
endif;
endwhile;
endif;
endwhile;
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment