Skip to content

Instantly share code, notes, and snippets.

@robbm76
Created May 18, 2016 12:30
Show Gist options
  • Save robbm76/d7d7f8840900cb64290d55ea878be74c to your computer and use it in GitHub Desktop.
Save robbm76/d7d7f8840900cb64290d55ea878be74c to your computer and use it in GitHub Desktop.
Sermon loop example
<?php ?>
<?php
while ( have_posts() ): the_post();
$speakers = get_the_terms( get_the_ID() , 'speaker' ); ?>
<div class="sermon">
<div class="sermon-archive-date one-sixth first">
<?php the_field( 'sermon_date' ); ?>
</div>
<div class="sermon-archive-content five-sixths">
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<?php if( $speakers ): ?>
<?php
foreach ( $speakers as $speaker) {
echo '<span class="speaker">' . $speaker->name . '</span>';
}
?>
<?php endif; ?> |
<a class="event-link" href="<?php the_permalink(); ?>">Full Details <i class="fa fa-icon fa-angle-right"></i></a><br>
<span class="sermon-buttons">
<?php if( get_field('sermon_audio_upload') ): ?>
<a class="button listen" target="_blank" href="<?php the_field( 'sermon_audio_upload' ); ?>">Listen</a>
<a class="button download" download href="<?php the_field( 'sermon_audio_upload' ); ?>">Download</a>
<?php endif; ?>
</span>
</div>
</div>
<?php
$count++;
endwhile;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment