functions - change default option in wp_dropdown_categories

admin2025-06-04  1

I'm using 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?

Thanks in advance

I'm using 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?

Thanks in advance

Share Improve this question asked Jun 24, 2011 at 13:48 GowriGowri 8614 gold badges19 silver badges37 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 3

You can use the show_option_all argument:

<?php $args = array(
'show_option_all'    => 'Categories'
);
wp_dropdown_categories( $args );
?>

Function Reference/wp dropdown categories

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748981456a315358.html

最新回复(0)