Skip to content

Instantly share code, notes, and snippets.

@BHWD
Created February 2, 2017 13:44
Show Gist options
  • Save BHWD/b0f6fdfc9c09871169d4eb67b982582e to your computer and use it in GitHub Desktop.
Save BHWD/b0f6fdfc9c09871169d4eb67b982582e to your computer and use it in GitHub Desktop.
<?php if ( have_rows( 'pe_accordian_item' ) ) : ?>
<?php while ( have_rows( 'pe_accordian_item' ) ) : the_row(); ?>
<?php the_sub_field( 'pe_accordian_item_item_title' ); ?>
<?php if ( have_rows( 'pe_accordian_item_item_content' ) ): ?>
<?php while ( have_rows( 'pe_accordian_item_item_content' ) ) : the_row(); ?>
<?php if ( get_row_layout() == '100%' ) : ?>
<?php the_sub_field( 'pe_accordian_item_content_100_wide' ); ?>
<?php elseif ( get_row_layout() == '50%' ) : ?>
<?php the_sub_field( 'pe_accordian_item_content_50_wide' ); ?>
<?php elseif ( get_row_layout() == '33%' ) : ?>
<?php the_sub_field( 'pe_accordian_item_content_33_wide' ); ?>
<?php endif; ?>
<?php endwhile; ?>
<?php else: ?>
<?php // no layouts found ?>
<?php endif; ?>
<?php endwhile; ?>
<?php else : ?>
<?php // no rows found ?>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment