wp_dropdown_categories, changing default text
-
I’m using
<?php wp_dropdown_categories(''); ?>to output a dropdown.In default view (without having clicked it) it shows the name of the first category in the list. I’d like it to say “Categories”. Is this possible?
I’m using the following for an archive dropdown:
<select style="width:130px" id="archive-dropdown" onChange='document.location.href=this.options[this.selectedIndex].value;'><option value="#"><?php echo attribute_escape(__('Months')); ?></option> <?php wp_get_archives('type=monthly&format=option&show_post_count=1'); ?></select>and this for a tag dropdown (also uses functions.php):
<select style="width:130px" id="tag-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;"><option value="#">Tags</option> <?php dropdown_tag_cloud('number=10&orderby=count&order=DESC'); ?></select>Is it possible to format the code to output a category dropdown in a similar way, to have more control?
The topic ‘wp_dropdown_categories, changing default text’ is closed to new replies.