0

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?

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.