Skip to content

Instantly share code, notes, and snippets.

@Niloys7
Last active June 13, 2017 14:49
Show Gist options
  • Save Niloys7/ca67b8d1d15c04577bd8076671b92a60 to your computer and use it in GitHub Desktop.
Save Niloys7/ca67b8d1d15c04577bd8076671b92a60 to your computer and use it in GitHub Desktop.
// 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