Home › Forums › Bug Reports › Flexible Content data still in wp_postmeta after layout removed › Reply To: Flexible Content data still in wp_postmeta after layout removed
I don’t think I am? I started with just one layout, “columns”, displayed like this:
`// check if the flexible content field has rows of data
if( have_rows(‘sections’) ) {
// loop through the rows of data
while ( have_rows(‘sections’) ) {
the_row();
if( get_row_layout() == ‘columns’ ) {
if (get_sub_field(‘column_1_content’)) {
echo ‘<div class=”col col-1″>’ . get_sub_field(‘column_1_content’) . ‘</div>’;
}
if (get_sub_field(‘column_2_content’)) {
echo ‘<div class=”col col-2″>’ . get_sub_field(‘column_2_content’) . ‘</div>’;
}
if (get_sub_field(‘column_3_content’)) {
echo ‘<div class=”col col-3″>’ . get_sub_field(‘column_3_content’) . ‘</div>’;
}
if (get_sub_field(‘column_4_content’)) {
echo ‘<div class=”col col-4″>’ . get_sub_field(‘column_4_content’) . ‘</div>’;
}
if (get_sub_field(‘column_5_content’)) {
echo ‘<div class=”col col-5″>’ . get_sub_field(‘column_5_content’) . ‘</div>’;
}
}
}
}
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.