The selected
parameter just defines which option is selected when the select field is rendered.
it’s an optional parameter that defaults to the current category or 0
$defaults['selected'] = ( is_category() ) ? get_query_var( 'cat' ) : 0;
(https://developer.wordpress.org/reference/functions/wp_dropdown_categories/)
This function is for rendering a category drop down, but you can override it to work with any taxonomy. It looks like your code is using an arbitrary taxonomy rather than a ‘category’. So you need to provide the value.
In your code where is the value for $taxonomy
coming from? What php template is this code running in?
Related Posts:
- Exclude custom taxonomy from search results and archive pages
- Search for tags
- Filter taxonomy terms using multiple id in the edit-tags.php
- If search matches taxonomy
- Check for taxonomy archive on search results page
- How to make tags show up in search results?
- Modify output of wp_dropdown_categories to add term IDs to each option
- Search Media by taxonomy
- Show only first child in dropdown
- WP Search using taxonomy terms
- Change searching from world level to first letter
- Is possible hide hierarchical select dropdown created by jetsmartfilters? (only visual issue)
- Including taxonomy in searches
- Custom dropdown search form that allows users to select option B based from Option 1
- Display taxonomy terms when adding a link in the admin
- Can the default “post tags” taxonomy be renamed?
- Remove the category/taxonomy description field?
- How can I create a taxonomy meta-box with search suggestions but no new terms input?
- Custom Taxonomy as Dropdown in admin
- How to organize and cache additional data associated with terms?
- get a specific taxonomy term name
- get_terms() How many is TOO many?
- How to display child term of current term’s parent taxonomy?
- Sorting custom taxonomy causes menus error
- Set a cookie in WordPress, using a select form and Jquery
- Is there any difference between post in child term and child & parent terms?
- Sort posts by number of matched terms
- Create and move terms for taxonomies
- Custom taxonomy archive – No posts found [closed]
- Display parent taxonomy name and list child taxonomies below it?
- How can I remove links from the function “get term list”?
- Alphabetical order in taxonomy.php
- Get Term names from WP Term Object
- functions to create term and child terms
- base directories / URL
- WordPress REST get all items without a taxonomy assigned
- Search results sorted by post types
- How do I get the current tag out of a taxonomy?
- Variable in Array Not Working
- How to list 2 taxonomy terms for a post, based on their hierarchy
- Custom Field as Custom Taxonomy?
- Customising the search function?
- custom wp_dropdown_categories items in wordpress
- Plugin to assign parent category on multiple taxonomy terms
- Pagination on taxonomy archive pages breaks
- Modify the query method when adding category filtering function to the custom post list
- Use a CPT as a taxonomy
- need to get postthumnails from a post whithin a category custom post type
- how to display only the sub category names of the taxonmoy
- Adding tag’s featured image to tag archive
- Individual post. Meta_key, taxonomy or post status for separation?
- Taxonomy archive page WP_Query does not return get_the_permalink() or get_permalink() value
- Adding taxonomy terms based on custom field
- How to show taxonomy image instead of taxonomy name on a list
- Multi Taxonomies same terms
- benefits of the table ‘wp_term_taxonomy’
- How to save a multiple checkbox array into a non-hierarchical taxonomy
- Create custom taxonomy and Display in metabox dropdown
- Query Custom Post Type by Taxonomy Meta Value
- `get_terms()` with `child_of` and `childless` combined
- Add text to the end of each list item in wp_list_categories
- Taxonomy list names with lowercase
- echo term name outside the loop, using term slug
- What are these undocumented arguments for register_taxonomy?
- Dynamic filtering of posts with custom taxonomies
- Sorting tags by name
- How to display only the direct children of a term on a taxonomy page
- How to get terms from a custom taxonomies after WordPress 4.5.0
- Get Taxonomy name from “registered_taxonomy” hook
- In two-category searches, where does WordPress save the title of the 2nd category?
- Custom Post Type + Custom Taxonomy = Archive Listing Page Problems
- Taxonomy term archive default loop returns 1 record instead of 8
- Building a Data Intensive Website with WordPress
- archive page sidebar not working
- Related terms – Terms that feature in post of current term
- Select query with two and two related taxonomies
- Get something out from taxonomy
- Taxonomy Dropdown Question
- Customize menu link for taxonomy in WP menu
- How To Query For An Empty Taxonomy Field
- How to have article URL like example.com/article1 and example.com/foo/article2?
- Add specific content to a taxonomy results page
- Set the limit of taxonomy per page
- I need posts within a taxonomy category that are tagged “featured” to show up first
- How to position taxonomy meta box on page
- Same page for startpage and archive?
- WP REST API taxonomy is missing on custom post type
- taxonomy terms are not populating select tag options
- how to print post tags [duplicate]
- Filtering posts by taxonomy and meta_value
- What to do with shared terms splitting in WordPress 4.2?
- How to get a query odered by N of matching taxonomies?
- Select All not working in a WordPress search filter
- Help me add Taxonomy to byline
- How Can I List Categories by Date?
- Child Terms not Displaying on the Taxonomy Term Admin Screen
- multiple taxonomies in wp_list_categories’ $args
- How to display a term of taxonomy
- Custom Titles for Multiple Tag Taxonomy Page
- Add new taxonomy in WP without generate any url