bodiequirk
7/25/2015 - 5:52 AM

Text Blocks in Dynamik with ACF

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();