Guest User

Untitled

a guest
Mar 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <form id="revenda">
  2. <?php
  3. /** The taxonomy we want to parse */
  4. $taxonomy = "localizacao";
  5. /** Get all taxonomy terms */
  6. $terms = get_terms($taxonomy, array(
  7. "orderby" => "count",
  8. "hide_empty" => false,
  9.  
  10. )
  11. );
  12. /** Get terms that have children */
  13. $hierarchy = _get_term_hierarchy($taxonomy);
  14. ?>
  15. <select name="terms" id="terms">
  16.  
  17.  
  18. <?php
  19. /** Loop through every term */
  20. foreach($terms as $term) {
  21. /** Skip term if it has children */
  22. if($term->parent) {
  23. continue;
  24. }
  25. echo '<option value="' . $term->slug . '">' . $term->name . '</option>';
  26. }
  27. ?>
  28. </select>
  29. </form>
Add Comment
Please, Sign In to add comment