Created
July 25, 2015 05:42
-
-
Save bodiequirk/5e3714a56fe597c17d2c to your computer and use it in GitHub Desktop.
ACF Nested Repeater Field to Table for Genesis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'genesis_entry_content', 'rainbow_assemblies_of_ca' ); | |
function rainbow_assemblies_of_ca() { | |
if ( have_rows('assemblies_of_ca') ): | |
while ( have_rows('assemblies_of_ca') ) : the_row(); ?> | |
<h2 class="decade-title"><?php the_sub_field('region_of_ca'); ?></h2> | |
<?php if ( have_rows('assembly_info') ): ?> | |
<table> | |
<thead> | |
<tr class="assemblies-row"> | |
<td>City</td> | |
<td>Address</td> | |
<td>Meeting Times</td> | |
<td>Contact Person</td> | |
</tr> | |
</thead> | |
<?php while ( have_rows('assembly_info') ) : the_row(); ?> | |
<tr> | |
<td><?php the_sub_field('assembly_city'); ?></td> | |
<td><?php the_sub_field('assembly_address'); ?></td> | |
<td><?php the_sub_field('assembly_meeting_times'); ?></td> | |
<td><?php the_sub_field('assembly_contact_person'); ?></td> | |
</tr> | |
<?php endwhile; // end assemblies info ?> | |
</table> | |
<?php endif; // end assembly_info ?> | |
<?php endwhile; // end assemblies_of_ca ?> | |
<?php endif; // end assemblies_of_ca | |
} // End rainbow_assemblies_of_ca(); | |
genesis(); // Initialize Genesis | |
// End of File |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was used on the CA Rainbow site.