Skip to content

Instantly share code, notes, and snippets.

@tradesouthwest
Created September 9, 2018 03:31
Show Gist options
  • Save tradesouthwest/65b077ce83fbe815909d4d61e55e04d8 to your computer and use it in GitHub Desktop.
Save tradesouthwest/65b077ce83fbe815909d4d61e55e04d8 to your computer and use it in GitHub Desktop.
/**
* print custom post type category list
* @cpt name= hordes
* @taxonomy name= hordes-category
*/
if ( ! function_exists( 'theme_entry_footer_cat_list' ) ) :
function theme_entry_footer_cat_list() {
// Get custom taxonomy project_category for each specific CPT
if ( 'hordes' === get_post_type() ) {
echo '<span class="cat-links">';
echo get_the_term_list( $post->ID, 'hordes-category', '', ', ' );
echo '</span>';
}
}
endif;
/**
* Or just add inline
*/
<footer class="hrds-meta_footer">
<ul class="hrds-list-inline">
<li><span class="hrds-tagcats"><?php echo get_the_term_list( $post->ID, 'hordes-category', '', ', ' ); ?>
<em class="hrds-author"><?php the_author(); ?></em> <time><?php the_date(); ?></time></li>
</ul>
</footer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment