1

To make a dropdown list from categories I can use wp_dropdown_categories function.

http://codex.wordpress.org/Function_Reference/wp_dropdown_categories

But how can I do the same thing but for my custom taxnomy called e.g. post_city ?

So, far I tried:

<?php 
    $args = array(
        'taxonomy' => array(
           'post_city',
         ) 
    );
    ?>
<?php wp_dropdown_categories($args); ?>

but only the first tag is shown in the dropdown ;(

  • You can't answer your question within. Please separate the solution from the question and post it as an answer. – Mayeenul Islam Jul 16 '13 at 10:18
  • ok,now it's fixed ;). – Derfder Jul 16 '13 at 10:20
0

SOLVED!!! ;D

I need to use 'hide_empty' => 0 instead of 'hide_empty' => 1 in the arguments array like:

<?php 
        $args = array(
            'taxonomy' => array(
               'post_city',
             ),
            'hide_empty' => 0
        );
    ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.