سؤال

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

هل كانت مفيدة؟

المحلول

You can use the show_option_all argument:

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

Function Reference/wp dropdown categories

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى wordpress.stackexchange
scroll top