Created
August 1, 2017 17:50
-
-
Save mikeoberdick/f67d38f575a4b00bc9ddde39df7a861b to your computer and use it in GitHub Desktop.
Show All Custom Post Type Taxonomy Terms
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 | |
$taxonomy = 'portfolio_categories'; | |
$terms = get_terms($taxonomy); // Get all terms of a taxonomy | |
if ( $terms && !is_wp_error( $terms ) ) : | |
?> | |
<ul> | |
<?php foreach ( $terms as $term ) { ?> | |
<li><a href="<?php echo get_term_link($term->slug, $taxonomy); ?>"><?php echo $term->name; ?></a></li> | |
<?php } ?> | |
</ul> | |
<?php endif;?> | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment