Support

Account

Home Forums Front-end Issues Flexible content

Helping

Flexible content

  • Hi,
    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.

    Nice day!

    M.

                <?php
    
                // 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' );
    
                        endif;
    
                    endwhile;
    
                else :
    
                    // no layouts found
    
                endif;
    
                ?>
  • On new page it shows two “rows” different types. But they´re 4 rows 🙁

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Flexible content’ is closed to new replies.