WordPress.org

Ready to get started?Download WordPress

Forums

how to use drop down menu for custom taxonomies? (2 posts)

  1. qzha017
    Member
    Posted 1 year ago #

    I have searched days and the closest thing I came to is this
    http://wp.tutsplus.com/tutorials/creative-coding/how-to-use-radio-buttons-with-taxonomies

    It describes how you can use radio button instead of tick box, and in it mentioned you could change the radio button to the drop down menu but didn't give instruction on how to. I am suppose to change the below codes to use drop down instead of radio button but dont know how to.

    <!-- Display taxonomy terms -->
            <div id="<?php echo $taxonomy; ?>-all" class="tabs-panel">
                <ul id="<?php echo $taxonomy; ?>checklist" class="list:<?php echo $taxonomy?> categorychecklist form-no-clear">
                    <?php   foreach($terms as $term){
                        $id = $taxonomy.'-'.$term->term_id;
                        echo "<li id='$id'><label class='selectit'>";
                        echo "<input type='radio' id='in-$id' name='{$name}'".checked($current,$term->term_id,false)."value='$term->term_id' />$term->name<br />";
                       echo "</label></li>";
                    }?>
               </ul>
            </div>

    I wanted to make the drop down boxes heirachical drop down selectors where the options of the child will depend on the parent selection. say: I selected australia, the drop down box below (preferably a separat drop down box)will only show citys in australia for selection and not every term/cities

    I want to get this done preferably by plugin but havent found any or are not working, or to add codes to the function.php file just like you would add custom taxonomies

    Thank you so much in advance for your help.

  2. qzha017
    Member
    Posted 1 year ago #


Topic Closed

This topic has been closed to new replies.

About this Topic