Skip to content

Instantly share code, notes, and snippets.

@bodiequirk
Last active August 29, 2015 14:25
Show Gist options
  • Save bodiequirk/c672d08b5684f70d488f to your computer and use it in GitHub Desktop.
Save bodiequirk/c672d08b5684f70d488f to your computer and use it in GitHub Desktop.
Text Blocks in Dynamik with ACF
<?php
// Add custom content to posts
add_action( 'genesis_entry_content', 'ch_add_text_block');
function ch_add_text_block() {
// check if the flexible content field has rows of data
if( have_rows('content') ):
// loop through the rows of data
while ( have_rows('content') ) : the_row();
if( get_row_layout() == 'text_block' ):
the_sub_field('left_column_text');
the_sub_field('right_column_text');
elseif( get_row_layout() == 'download' ):
$file = get_sub_field('file');
endif;
endwhile;
else :
// no layouts found
endif;
}
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment