Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form id="revenda">
- <?php
- /** The taxonomy we want to parse */
- $taxonomy = "localizacao";
- /** Get all taxonomy terms */
- $terms = get_terms($taxonomy, array(
- "orderby" => "count",
- "hide_empty" => false,
- )
- );
- /** Get terms that have children */
- $hierarchy = _get_term_hierarchy($taxonomy);
- ?>
- <select name="terms" id="terms">
- <?php
- /** Loop through every term */
- foreach($terms as $term) {
- /** Skip term if it has children */
- if($term->parent) {
- continue;
- }
- echo '<option value="' . $term->slug . '">' . $term->name . '</option>';
- }
- ?>
- </select>
- </form>
Add Comment
Please, Sign In to add comment