Support

Account

Home Forums Add-ons Flexible Content Field Image not dispalying front end. Reply To: Image not dispalying front end.

  • please wrap your code inside code tags (button at top of textfield, where you write forum post)
    and show the whole loop (at least the if get_row_layout part. of course you can/should reduce fields/layouts to dont get to long code. but we need to understand what you did wrong)

    did your code look somehow like this? :

    <?php
    // check if the flexible content field has rows of data
    if( have_rows('flexible_content_field_name') ):
         // loop through the rows of data
        while ( have_rows('flexible_content_field_name') ) : the_row();
            if( get_row_layout() == 'flexible_content_layout_name' ):
            	the_sub_field('some_field');
            elseif( get_row_layout() == 'other_flexible_content_layout_name' ): 
            	$field = get_sub_field('other_field');
            	echo $field;
            endif;
        endwhile;
    else :
        // no layouts found
    endif;
    ?>