I'm using this code to get a dropdown list of categories, but all options are marked as selected. Therefore, the last option is the one that is displayed as selected by default.
<?php wp_dropdown_categories( array( 'class' => 'form-control', 'show_option_none' => 'Search by category...', 'hierarchical' => true, 'depth' => 1, 'hide_empty' => true, 'exclude' => 1, 'orderby' => 'NAME', 'value_field' => 'slug', ) ); ?>
I also tried with the following parameter, but it didn't work.
'select' => 0
How can I prevent the selected attribute to be assigned to all items?