Created
January 19, 2013 15:20
-
-
Save TheHeat/4573126 to your computer and use it in GitHub Desktop.
In Wordpress, if more than a single term exists within a given taxonomy, display the terms as links to their archives.
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 $terms = get_terms("taxonomy_name"); | |
$count = count($terms); | |
if ( $count > 1 ): foreach ( $terms as $term ): ?> | |
<a href="<?php echo get_bloginfo('url') . '/taxonomy_slug/' . $term->slug ?>"><?php echo $term->name ?></a> | |
<?php endforeach; endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment