• Hello all,

    I’m trying to build a form with a dropdown list that contains the list of categories (I don’t want to use the wp_dropdown_categories function because when you click it displays the category)

    However, it seems the taxonomy is lost. I mean, all the categories are shown but there is no parent/child grouping.

    You can see what I’m saying here:

    http://enlaze.net/?page_id=865

    Parent categories are “Busco enlaZe” and “Ofrezco enlaZe”. The rest are children and I’d like to have them below “Busco enlaZe” and “Ofrezco enlaZe” depending on their relationships.

    The code I’m using is this:

    <p id=”et_choose_cat”>
    <select name=”drop_cat”>
    <?php
    $categories = get_categories( apply_filters( ‘elist_taxonomy_categories’, array(
    ‘hierarchical’ => 1,
    ‘taxonomy’ => ‘listing_category’,
    ‘name’ => ‘drop_categories’) ) );

    foreach ($categories as $category) {
    $option = ‘<option value=”‘.$category->cat_name.'”>’;
    $option .= $category->cat_name;
    $option .= ‘</option>’;
    echo $option;
    }
    ?>
    </select>
    </p>

    Thank you for your help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The function wp_dropdown_categories() doesn’t link to anything by default when making a selection. You must have something in your code that is causing it to redirect to that particular category.

    Thread Starter enlazeworldwide

    (@enlazeworldwide)

    Hello JarretC,

    Thanks for your reply.

    I’m actually using this piece of code:

    wp_dropdown_categories( array(‘show_option_none’ => ‘Choose a category’,’hierarchical’ => 1,’taxonomy’ => ‘listing_category’, ‘name’ => ‘elist_categories’));

    What do you think?

    Thanks a lot.

    What exactly are you wanting to know? That code should work although I don’t know your overall goal.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Category taxonomy not shown’ is closed to new replies.