Skip to content

Instantly share code, notes, and snippets.

@barbwiredmedia
Created February 17, 2015 22:32
Show Gist options
  • Save barbwiredmedia/cd222ee06491508bfbb2 to your computer and use it in GitHub Desktop.
Save barbwiredmedia/cd222ee06491508bfbb2 to your computer and use it in GitHub Desktop.
Wordpress ACF Flexible content field, layout selection
<?php
// check if the flexible content field has rows of data
if (have_rows('choose_layout')):
// loop through the rows of data
while (have_rows('choose_layout')) : the_row();
if (get_row_layout() == 'general_content'):
?>
//
<?php elseif (get_row_layout() == 'block_quote'): ?>
//
//
<?php elseif (get_row_layout() == 'large_image_with_caption'): ?>
<?php
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