
<?php
// check if the flexible content field has rows of data
if( have_rows('flexible_inhalte') ):;?>
<?php
// loop through the rows of data
while ( have_rows('flexible_inhalte') ) : the_row();
if( get_row_layout() == 'flexible_inhalte_kopfbild' ):
$image = get_sub_field('flexible_inhalte_kopfbild')['url'];
echo '<div class="page-fullhead" style="background:url('.$image.');height:450px;max-height:450px;width:100%;background-size:cover;background-position:center;">';
echo '</div>';
echo '<div id="wrapper">';
echo '<div class="container page-main">';
echo '<div class="row">';
elseif( get_row_layout() == 'flexible_inhalte_text' ):
echo '<div class="col-lg-7 col-md-7 col-sm-12 col-xs-12">';
$main_text = get_sub_field('flexible_inhalte_text');
echo $main_text;
echo '</div>';
elseif( get_row_layout() == 'flexible_inhalte_icon' ):
echo '<div class="col-lg-3 col-lg-offset-1 col-md-3 col-md-offset-1 col-sm-12 col-xs-12 side-icon">';
echo '<div class="inner-wrap">';
$main_icon = get_sub_field('flexible_inhalte_icon_icon');
$main_icon_text = get_sub_field('flexible_inhalte_icon_bezeichnung');
echo '<img src='.$main_icon['url'].'>';
echo '<div class="saeulen-text">';
echo $main_icon_text;
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
endif;
endwhile;
else :
// no layouts found
endif;
?>
I would like wrap all row divs into a div container (id=”wrapper”). The sub_field(‘flexible_inhalte_kopfbild’) must be above.
That is not possible because I won’t wrap the sub_field(‘flexible_inhalte_kopfbild’)