Created
November 15, 2015 15:49
-
-
Save mattradford/10c0e5fbfa7236839758 to your computer and use it in GitHub Desktop.
Get first taxonomy term
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
$tax = 'property-type'; | |
$tax_terms = wp_get_object_terms( $post->ID, $tax ); | |
if (!empty( $tax_terms )) { | |
$term = array_pop($tax_terms); | |
_e('This is a ','turnerestates'); | |
echo '<a href="' . get_term_link( $term->slug, $tax ) . '">' . strtolower($term->name) . '</a>'; | |
_e(' property.','turnerestates'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment