Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--Start Grid -->
- <div class="uk-grid <?php if($gutter !=""){echo $gutter;}?>">
- <?php
- if ( have_rows('blocks') ):
- // loop through the rows of data
- while ( have_rows('blocks') ) : the_row();
- //Retrieve Variables from Repeater Feild Blocks
- $content = get_sub_field('body_content');
- $smallWidth = get_sub_field('small_width');
- $mediumWidth = get_sub_field('medium_width');
- $largeWidth = get_sub_field('large_width');
- $customStyle = get_sub_field('custom_styles');
- $styles = array();
- if($smallWidth != "" || $mediumWidth != "" || $largeWidth != ""){
- array_push($styles, $smallWidth, $mediumWidth, $largeWidth);
- }
- //Building out HTML for Grid element
- ?>
- <div class="<?php foreach($styles as $style){echo $style ." ";}?>" <?php if($customStyle != ""){echo 'style="'.$customStyle.'"';}?>>
- <?php echo $content?>
- </div>
- <?
- endwhile;
- else :
- echo 'No Rows Found. Please add some.';
- endif;
- ?>
- </div> <!--End Grid -->
Advertisement
Add Comment
Please, Sign In to add comment