Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <div class="countries">
  2. -country
  3. -country
  4. -country
  5. </div>
  6.  
  7. <?php if ( !has_term('juice', 'types' ) ): ?>
  8. <div class="countries">
  9. <p>Country</p>
  10. <ul>
  11. <?php
  12.  
  13. //get the current term
  14. $current_term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
  15.  
  16. //then set the args for wp_list_categories
  17. $args = array(
  18. 'child_of' => $current_term->term_id,
  19. 'taxonomy' => 'countries',
  20. 'hide_empty' => 1,
  21. 'order' => 'ASC',
  22. 'show_count' => 1,
  23. 'hierarchical' => true,
  24. 'depth' => 1,
  25. 'title_li' => ''
  26. );
  27. wp_list_categories( $args );
  28. ?>
  29. </ul>
  30.  
  31. </div>
  32. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement