This WordPress plugins gives you a shortcode and a widget to display dynamic parent and child category dropdown using Ajax.
Download the zip file and upload it to your WordPress plugins. Activate the plugin. You can use the shortocde [wpcd_child_categories_dropdown] to create the dropdown.
Here are the options available with the shortcode:
- orderby
- order
- showcount
- hierarchical
- hide_empty
- exclude
- include
- default_option_text (This is the text that is shown as the default option for the parent dropdown)
- default_option_sub (This is the text that is shown as the default option for the child category dropdown)
- category
You can read more about the options here - https://developer.wordpress.org/reference/functions/wp_dropdown_categories/
You can also use a widget to display the dropdown on the sidebar.
Please note that the shortcode and the widget cannot be used on the same page.