Created
July 22, 2016 16:57
-
-
Save NateJLewis/7486ad497d50558d0c5076c616d2bfbe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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