Skip to content

Instantly share code, notes, and snippets.

@sarah-hunter
Created August 19, 2015 17:37
Show Gist options
  • Save sarah-hunter/fffbd5b3d8e4047ae81c to your computer and use it in GitHub Desktop.
Save sarah-hunter/fffbd5b3d8e4047ae81c to your computer and use it in GitHub Desktop.
<?php while ( have_posts() ) : the_post(); ?>
<div class="single-lesson">
<h5><?php the_title(); ?></h5>
<p class="lesson-grade"><?php $terms = get_the_terms( $post->ID, 'subject' );
if ( $terms ) { foreach ( $terms as $term ) { echo '<span class="each-tag">'; echo $term->name; echo '</span>'; } } ?></p>
<p class="lesson-grade"><?php $terms = get_the_terms( $post->ID, 'grade' );
if ( $terms ) { foreach ( $terms as $term ) { echo '<span class="each-tag">'; echo $term->name; echo '</span>'; } } ?></p>
<p class="lesson-theme"><?php $terms = get_the_terms( $post->ID, 'theme' );
if ( $terms ) { foreach ( $terms as $term ) { echo '<span class="each-tag">'; echo $term->name; echo '</span>'; } } ?></p>
<p class="download-link"><a href="<?php the_field('lesson_plan'); ?>" target="_blank"><i class="fa fa-arrow-down fa-lg"></i></a></p>
</div>
<?php endwhile; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment