Skip to content

Instantly share code, notes, and snippets.

@emaildano
Created May 6, 2014 21:11
Show Gist options
  • Save emaildano/96530355839fd2c302b2 to your computer and use it in GitHub Desktop.
Save emaildano/96530355839fd2c302b2 to your computer and use it in GitHub Desktop.
Starter for creating a left / right independent columns.
<?php
// Two Column Repeater to hold Left / Right Flexible Content Fields
if( have_rows('two_col_row') ): while ( have_rows('two_col_row') ) : the_row(); ?>
<?php
// left col flexible content
while(has_sub_field("left_column")): ?>
<?php if(get_row_layout() == "body_copy"): // layout: Content ?>
<?php the_sub_field('title'); ?>
<?php the_sub_field('body_copy'); ?>
<?php endif; ?>
<?php endwhile; ?>
<?php
// right col flexible content
while(has_sub_field("right_column")): ?>
<?php if(get_row_layout() == "body_copy"): // layout: Content ?>
<?php the_sub_field('title'); ?>
<?php the_sub_field('body_copy'); ?>
<?php endif; ?>
<?php endwhile; ?>
<?php endwhile; endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment