Title: Display taxonomy values
Last modified: October 14, 2017

---

# Display taxonomy values

 *  Resolved [dlikelith](https://wordpress.org/support/users/dlikelith/)
 * (@dlikelith)
 * [9 years ago](https://wordpress.org/support/topic/regarding-shortcode/)
 * Hello,
 * Could you please help me with php code to display custom taxonomy values.
    I 
   mean like there is a custom taxonomy by name “localstore”, values are BLUE and
   RED. Is there a php code that display these values. I tried this code, it shows
   but with errors. I use it in woocommerce product description.
 *     ```
       <?php
   
       $terms = get_the_terms( $post->ID, 'localstore' );
       if ($terms) {
           foreach($terms as $term) {
             echo $term->name;
           } 
       }
   
       ?>
       ```
   
 * Thank you.
    -  This topic was modified 9 years ago by [dlikelith](https://wordpress.org/support/users/dlikelith/).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [9 years ago](https://wordpress.org/support/topic/regarding-shortcode/#post-9587968)
 * What errors are you seeing? Nothing is standing out as wrong with this code snippet.
 *  [dkirmis](https://wordpress.org/support/users/dkirmis/)
 * (@dkirmis)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/regarding-shortcode/#post-9610347)
 * Would you place this code into archive.php?
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [8 years, 11 months ago](https://wordpress.org/support/topic/regarding-shortcode/#post-9612024)
 * [@dkirmis](https://wordpress.org/support/users/dkirmis/) this would go in whatever
   template file controls where you want to show this information.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [8 years, 11 months ago](https://wordpress.org/support/topic/regarding-shortcode/#post-9629870)
 * Any changes with this one [@dlikelith](https://wordpress.org/support/users/dlikelith/)?
 *  Thread Starter [dlikelith](https://wordpress.org/support/users/dlikelith/)
 * (@dlikelith)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/regarding-shortcode/#post-9650482)
 * I am not prof, so I do not know, maybe there is something with the theme, but
   for me this code worked:
 *     ```
         <?php
   
             $term_list = get_the_term_list( get_the_ID(), 'localstore', '<span class="store_post_meta_item">', ', ', '</span>' );
             if($term_list){
              echo '<a href="'.$term_list.'</a>';
   
              }  
   
       ?>
       ```
   
    -  This reply was modified 8 years, 11 months ago by [dlikelith](https://wordpress.org/support/users/dlikelith/).

Viewing 5 replies - 1 through 5 (of 5 total)

 The topic ‘Display taxonomy values’ is closed to new replies.

 * ![](https://ps.w.org/custom-post-type-ui/assets/icon-256x256.png?rev=2744389)
 * [Custom Post Type UI](https://wordpress.org/plugins/custom-post-type-ui/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-post-type-ui/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-post-type-ui/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-post-type-ui/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-post-type-ui/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-post-type-ui/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [dlikelith](https://wordpress.org/support/users/dlikelith/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/regarding-shortcode/#post-9650482)
 * Status: resolved