Support

Account

Home Forums General Issues Getting an if else to work Reply To: Getting an if else to work

  • I Managed to workout out, I had renamed the label on the flexible content, which ACF pro dosnt like, i had to create a new flexible content area and then re populate it. And i included the missing column container missing.

    The Last Endif was needed so thank you ichabod1799


    <?php
    // loop through the rows of data
    if( have_rows(‘school_box’) ):

    // add a counter
    $count = 0;
    $group = 0;

    while ( have_rows(‘school_box’) ) : the_row();
    //print(get_row_layout());

    if ($count % 3 == 0) {
    $group++;

    ?>
    <div id=”<?php echo $group; ?>” class=”row group-<?php echo $group; ?>” data-equalizer> <!–Begin Row:–>
    <?php
    }
    ?>

    <?php

    if( get_row_layout() == ‘link_box’ ):
    ?>

    <div class=”large-4 medium-4 columns panel” data-aos=”fade-up” data-aos-delay=”150″>
    <div>” target=”_blank”>” alt=”<?php the_title(); ?>”></div>
    <div class=”profile-box”>” target=”_blank”><?php echo the_sub_field(‘staff_name’); ?></div>
    </div>

    <?php

    elseif( get_row_layout() == ‘video_box’ ):

    ?>
    <div class=”large-4 medium-4 columns panel” data-aos=”fade-up” data-aos-delay=”150″>
    <div class=”video-parent”>
    <div>” target=”_blank”>” alt=”<?php the_title(); ?>”></div>

    <div class=”video-inner”>
    ” target=”_blank”>
    </div>
    </div>
    <div class=”profile-box”>” target=”_blank”><?php echo the_sub_field(‘staff_name’); ?></div>
    </div>

    <?php

    endif;
    if ($count % 3 == 2) {
    ?>

    </div>

    <?php
    }
    $count++;
    endwhile;
    else :
    // no rows found
    endif; ?>