Support

Account

Home Forums ACF PRO Insert code between get_row_layout() Reply To: Insert code between get_row_layout()

  • Hi @marco-b

    I believe you can do it like this:

    <?php if( have_rows('blocks') ):?>
        <?php $i = 0; ?>
        <?php while ( have_rows('blocks') ) : the_row();?>
            
            <?php if( get_row_layout() == 'full_screen' ):?>
    
                <div class="fullscreen"><!--content--></div>
    
            <?php elseif( get_row_layout() == 'box' ):?>
            
                <?php if($i == 0){ ?>
                <div class="row">
                <?php
                }
                $i++;
                ?>
                    <div class="col-sm-3"><!--content--></div>
              
            <?php endif;?>
    
        <?php endwhile;
                </div>
    	else :

    Hope this helps!