Created
April 7, 2014 16:14
-
-
Save benfavre/10023351 to your computer and use it in GitHub Desktop.
Php display taxonomy terms
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 terms for post | |
$terms = get_the_terms( $post->ID , 'oil' ); | |
// Loop over each item since it's an array | |
if ( $terms != null ){ | |
foreach( $terms as $term ) { | |
// Print the name method from $term which is an OBJECT | |
print $term->slug ; | |
?> | |
<?php | |
// Affiche directement un lien vers les pages sommaires de ces taxonomies, à voir/ajuster | |
echo custom_taxonomies_terms_links(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment