Last active
June 13, 2017 14:49
-
-
Save Niloys7/ca67b8d1d15c04577bd8076671b92a60 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Display Taxomonies | |
$terms = get_terms( 'fw-portfolio-category' ); // Taxomony Name | |
foreach ( $terms as $term ) { | |
// The $term is an object, so we don't need to specify the $taxonomy. | |
$term_link = get_term_link( $term ); | |
// If there was an error, continue to the next term. | |
if ( is_wp_error( $term_link ) ) { | |
continue; | |
} | |
// We successfully got a link. Print it out. | |
echo '<a href="' . esc_url( $term_link ) . '">' . $term->name . '</a>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment