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 want to let the users search posts by categories. So I use wp_dropdown_categories to build a drop-donw list with all categories. Trouble is I want to allow them to set this to "ALL CATEGORIES" as well. So how can I add another entry in the drop-down list? Thanks,

share|improve this question
up vote 3 down vote accepted

Should be easy to do
(check the codex: wp dropdown categories)

<h2><?php _e('Categories:'); ?></h2>
    <?php wp_dropdown_categories('show_option_all=ALL CATEGORIES&show_count=1&hierarchical=1'); ?>

if you want to wrap with translation this is the way:

<h2><?php _e('Categories:'); ?></h2>
    <?php wp_dropdown_categories('show_option_all='.__('All Categories', 'your_text_domain').'&show_count=1&hierarchical=1'); ?>
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.