Skip to content

Instantly share code, notes, and snippets.

@henihan
Created April 18, 2017 21:13
Show Gist options
  • Save henihan/5c8be0bd92de7b361a1b2e9a1ab15d0e to your computer and use it in GitHub Desktop.
Save henihan/5c8be0bd92de7b361a1b2e9a1ab15d0e to your computer and use it in GitHub Desktop.
taxonomy-espresso-people_type-board-of-directors.php
<?php
get_header();
$post_type = 'espresso_people';
$taxonomy = 'espresso_people_type';
$terms = get_terms( array(
'taxonomy'=>$taxonomy,
'orderby'=>'name',
'order'=>'DESC',
));
// d($terms);
?>
<section id="container" class="<?php echo iced_mocha_get_layout_class(); ?>">
<div id="content" role="main">
<?php espresso_theme_before_content_hook(); ?>
<?php if ( have_posts() ) : ?>
<header class="page-header">
<?php
// the_archive_title( '<h1 class="page-title">', '</h1>' );
the_archive_description( '<div class="taxonomy-description">', '</div>' );
?>
</header>
<?php
foreach( $terms as $term ) :
if ($term->term_id != '437' && $term->term_id != '451') :
continue;
endif;
?>
<ul>
<?php
$posts = get_posts(array(
'post_type'=>$post_type,
'posts_per_page' => '-1',
'suppress_filters'=>false,
'tax_query'=>array(
array(
'taxonomy'=>$taxonomy,
'field'=>'slug',
'terms'=>$term
)
)
)
);
foreach( $posts as $post ) :
?>
<li>
<?php
get_template_part( 'content', get_post_type() ); ?>
</li>
<?php
endforeach;
if($iced_mocha_pagination=="Enable") iced_mocha_pagination(); else iced_mocha_content_nav( 'nav-below' );
?> </ul>
<?php
endforeach;
else : ?>
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'iced_mocha' ); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'iced_mocha' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; ?>
<?php espresso_theme_after_content_hook(); ?>
</div><!-- #content -->
<?php iced_mocha_get_sidebar(); ?>
</section><!-- #primary -->
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment