Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if( have_rows('page_layout_section') ): // check if the repeater field has rows of data ?>
- <?php while ( have_rows('page_layout_section') ) : the_row(); // loop through the rows of data ?>
- <?php // Store the variables ?>
- <?php
- if(get_sub_field('section_background_colour')) {
- $colour = get_sub_field('section_background_colour');
- };
- ?>
- <?php
- if(get_sub_field('section_background_image')) {
- $bgImg = get_sub_field('section_background_image');
- };
- ?>
- <?php if( have_rows('row') ): // check if the flexible content field has rows of data ?>
- <div class="section" style="background-color: <?php echo $colour ?>;">
- <?php while ( have_rows('row') ) : the_row(); // loop through the rows of data?>
- <?php if( get_row_layout() == 'full_width_row' ): ?>
- <div class="row row-full-width">
- <div class="grid-container">
- <div class="grid-100 grid-parent">
- <?php if( isset($bgImg) ) { ?>
- <img class="section-bg-img" src="<?php echo $bgImg ?>" />
- <?php } ?>
- <?php the_sub_field('column:_full_width'); ?>
- </div>
- </div>
- </div><!-- / end .row .full_width-->
- <?php elseif( get_row_layout() == '50_50_row' ): ?>
- <div class="row row-50-50">
- <div class="grid-container grid-parent">
- <div class="grid-50 tablet-grid-50">
- <?php if( isset($bgImg) ) { ?>
- <img class="section-bg-img" src="<?php echo $bgImg ?>" />
- <?php } ?>
- <?php the_sub_field('column_one'); ?>
- </div>
- <div class="grid-50 tablet-grid-50">
- <?php the_sub_field('column_two'); ?>
- </div>
- </div>
- </div><!-- / end .row .50-50 -->
- <?php elseif( get_row_layout() == 'circle-layout' ): ?>
- <div class="row row-circle-layout">
- <div class="grid-container">
- <div class="grid-66 tablet-grid-66 grid-parent">
- <?php if( isset($bgImg) ) { ?>
- <img class="section-bg-img" src="<?php echo $bgImg ?>" />
- <?php } ?>
- <?php the_sub_field('column_one'); ?>
- </div>
- <div class="grid-33 tablet-grid-33 grid-parent">
- <div class="circle">
- <div class="circle-content">
- <div class="circle-content-inner">
- <?php the_sub_field('column_two'); ?>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div><!-- / end .row .circle-layout -->
- <?php endif; // end if have 'row' ?>
- <?php endwhile; // end while have 'row' ?>
- </div><!-- //end .section -->
- <?php endif; // end flexible field loop ?>
- <?php endwhile; // end repeater field endwhile loop ?>
- <?php endif; // end repeater field ('page_layout_section') loop ?>
Advertisement
Add Comment
Please, Sign In to add comment