Skip to content

Instantly share code, notes, and snippets.

@benfavre
Created April 7, 2014 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benfavre/10023351 to your computer and use it in GitHub Desktop.
Save benfavre/10023351 to your computer and use it in GitHub Desktop.
Php display taxonomy terms
<?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