Skip to content

Instantly share code, notes, and snippets.

@reediredale
Created October 27, 2017 09:05
Show Gist options
  • Save reediredale/6f4bfffc3dac04f0f471fa6e650495c3 to your computer and use it in GitHub Desktop.
Save reediredale/6f4bfffc3dac04f0f471fa6e650495c3 to your computer and use it in GitHub Desktop.
<?php // check if the flexible content field has rows of data
if( get_field('flexible_content') ):
// loop through the rows of data
while ( has_sub_field('flexible_content') ) :
if( get_row_layout() == 'copy' ):
get_template_part('partials/copy', 'block');
elseif( get_row_layout() == 'image' ):
get_template_part('partials/images', 'block');
elseif( get_row_layout() == 'flexi' ):
get_template_part('partials/flexi', 'block');
endif;
endwhile;
else :
// no layouts found
endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment