Created
August 21, 2015 12:55
-
-
Save developer-anuragsingh/b01998c45a59760a69b1 to your computer and use it in GitHub Desktop.
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 | |
//Get the custom taxonomy term 'name' and 'description' | |
$taxonomy = 'YOUR_CUSTOM_TAXO_NAME'; | |
$terms = wp_get_object_terms( $post->ID, $taxonomy, array('orderby'=>'term_order') ); | |
if ( !empty( $terms ) && !is_wp_error( $terms ) ) { | |
$taxoID = $terms[1]->term_id; | |
#var_dump($terms); | |
$customTaxoName = $terms[1]->name; | |
$customTaxoDescription = term_description( $taxoID, 'YOUR_CUSTOM_TAXO_NAME' ); | |
if($customTaxoDescription != '') : | |
echo '<h2>'.$customTaxoName.'</h2>'; | |
echo '<p>'.$customTaxoDescription.'</p>'; | |
endif; | |
} ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment