can anybody say me, why this code not working for me? One line shows perfectly. But, if have more lines, it shows only first in order :-/.
I tried to do two if condition (without elseif), but the result were the same.
Thanks for your replies.
// check if the flexible content field has rows of data
if( have_rows('builder') ):
// loop through the rows of data
while ( have_rows('builder') ) : the_row();
if( get_row_layout() == 'homepage_section' ):
get_template_part( 'template-parts/layout/layout', 'homepage' );
elseif( get_row_layout() == 'boxes_section' ):
get_template_part( 'template-parts/layout/layout', 'boxes' );
// no layouts found
On new page it shows two “rows” different types. But they´re 4 rows 🙁