Created
February 17, 2015 22:32
-
-
Save barbwiredmedia/cd222ee06491508bfbb2 to your computer and use it in GitHub Desktop.
Wordpress ACF Flexible content field, layout selection
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 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