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;
?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.