I am currently pulling in an option drop-down of a specific category using:
<?php wp_dropdown_categories('child_of=20'); ?>
I would like the initial value of the drop-down to say 'Bedrooms' and not be the first category.
Is this possible?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
you can set the initial value of categories drop down by passing category id to selected parameter of wp_dropdown_categories function as shown in following code :
wp_dropdown_categories( array( 'child_of' => 20, 'selected' => get_cat_ID( 'Bedrooms' ) ) );
For more information on this visit this code page.