WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to use wp_dropdown_categories at front end. I got the dropdown box with default "uncategorized", the rest of the category is not there.

function cats_dropdown(){
    require_once(ABSPATH . '/wp-admin/includes/template.php');
    $args = array('taxonomy' => 'category');
     <?php wp_dropdown_categories($args); ?>

In the same function, if I try to output wp_terms_checklist, it works. This is confusing. Anything I missed in the dropdown?

share|improve this question
up vote 1 down vote accepted

It could be that it won't show empty categories, categories that has no posts attached to them.

Try to change $args = array('taxonomy' => 'category'); to $args = array('taxonomy' => 'category', 'hide_empty' => 0);

share|improve this answer

By default, wp_dropdown_categories only displays the categories that have posts. Set hide_empty argument to false to display all categories, even those without posts.

$args = array(
    'taxonomy'   => 'category'
    'hide_empty' => false

On the other hand, wp_terms_checklist will display all categories, even if they are empty.

share|improve this answer

You shouldn't need to define the taxonomy of category as that's the default. Have you tried just using the following?

<?php $args = array('show_option_none' => 'Categories', hide_empty => '0'); ?>
<?php wp_dropdown_categories($args); ?>
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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