Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * change 'product_cat' to your desired taxonomy.
  5. */
  6. $categories = get_terms( array(
  7. 'taxonomy' => 'product_cat',
  8. 'hierarchical' => false,
  9. ) );
  10.  
  11. $cat_list = array();
  12. sort_terms_hierarchically( $categories, $cat_list );
  13.  
  14. if ( $cat_list ) {
  15. echo '<ul class="terms-list">';
  16. echo sidebar_cat_list( $cat_list );
  17. echo '</ul>';
  18. }
  19.  
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement