Title: Ordering Current Post Taxonomy Terms
Last modified: August 31, 2016

---

# Ordering Current Post Taxonomy Terms

 *  [WebStyley](https://wordpress.org/support/users/webstyley/)
 * (@webstyley)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/ordering-current-post-taxonomy-terms/)
 * Hello,
 * I would like to organize the current posts taxonomies in a list with parent –
   child taxonomy terms.
 * For instance, I would like a structure like this:
 * Term
    -Term Child –Term Grandchild —Term Great Grandchild Term -Term Child –Term
   Grandchild —Term Great Grandchild
 * Here is the code I have been working with, but have come to a roadblock trying
   to achieve this. Thanks in advance.
 *     ```
       <ul style="
           font-size: 20px;
           -webkit-column-count: 4;
           -moz-column-count: 4;
           column-count: 4;
       	text-align: left;
       "><p style="font-weight: none; font-size: 10px;"><?php
       $args = array('orderby' => 'term_group', 'order' => 'ASC', 'fields' => 'all');
       $product_terms = wp_get_object_terms( $post->ID, 'zip-code' );
       if ( ! empty( $product_terms ) ) {
       	if ( ! is_wp_error( $product_terms ) ) {
   
       			foreach( $product_terms as $term ) {
       				echo '<a href="' . get_term_link( $term->slug, 'zip-code' ) . '">' . esc_html( $term->name ) . '</a> , ';
       			}
   
       	}
       }
       ?></p></ul>
       ```
   

Viewing 1 replies (of 1 total)

 *  [Sakar U Khatiwada](https://wordpress.org/support/users/sakaruk/)
 * (@sakaruk)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/ordering-current-post-taxonomy-terms/#post-7209786)
 * I think you can list the categories using the defaul function called wp_list_categoeis
   and style them accordingly to get the result as you want [https://codex.wordpress.org/Function_Reference/wp_list_categories](https://codex.wordpress.org/Function_Reference/wp_list_categories)

Viewing 1 replies (of 1 total)

The topic ‘Ordering Current Post Taxonomy Terms’ is closed to new replies.

## Tags

 * [taxonomy](https://wordpress.org/support/topic-tag/taxonomy/)
 * [wp_get_object_terms](https://wordpress.org/support/topic-tag/wp_get_object_terms/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Sakar U Khatiwada](https://wordpress.org/support/users/sakaruk/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/ordering-current-post-taxonomy-terms/#post-7209786)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
