Created
February 9, 2016 01:07
-
-
Save awakekat/41294e273def7efbd8b8 to your computer and use it in GitHub Desktop.
ACF repeater
This file contains 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 | |
/* | |
Template Name: Sunday Adult | |
*/ | |
get_header(); ?> | |
<div class="primary-content col-md-7 col-md-push-2"> | |
<main id="main" class="main" role="main"> | |
<?php echo the_content(); ?> | |
<?php $repeater = get_field('sunday_adult'); | |
// vars | |
$order = array(); | |
// populate order | |
foreach( $repeater as $i => $row ) { | |
$timestamp = strtotime($row['sunday_adult_day']); | |
$order[ $timestamp ][] = $row; | |
} | |
ksort($order); | |
?> | |
<ul> | |
<?php | |
foreach($order as $time => $eventDay) { | |
if($time <= time()) continue; | |
foreach($eventDay as $event) { | |
?> | |
<li> | |
<strong><?php echo $event['sunday_adult_day']; ?>: </strong> | |
<?php echo $event['sunday_adult_title']; ?> | |
<?php echo $event['sunday_adult_room']; ?> | |
</li> | |
<?php | |
} | |
} | |
?> | |
</ul> | |
</main><!-- #main --> | |
</div> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment