Follow the following steps to achieve your result,
- Use get_terms to fetch all of your parent taxonomies and render a drop-down with the title and setting a data attribute with the term ID. Please set the args “parent” to 0 and taxonomy to your taxonomy slug.
- Write a jQuery script to fire an AJAX on the above created drop-down. The AJAX should send the selected term ID and should handle the request by sending a JSON reply of an array of the child term titles and IDs using the function get_term_children
- Handle the JSON encoded array in the AJAX complete/success callback of jQuery to add the sub-taxonomies into the other drop-down.
Related Posts:
- How do I Make a Theme “plugin-ready”?
- What’s the difference between hooks, filters and actions? [duplicate]
- How to use filter hook ‘post_updated_messages’ in coherence with action hook ‘save_post’
- Difference Between Filter and Action Hooks?
- ajaxurl not defined on front end
- Why does WordPress use outdated jQuery v1.12.4?
- How to include jQuery and JavaScript files correctly?
- Is there widely accepted phpDoc syntax for documenting which hook calls a function?
- Explanation of the “posts_join” and “posts_fields” filter hooks?
- How do you use the plugin boilerplate loader class to hook actions and filters?
- jQuery in header or footer
- How to Add a .js file Only in one specific Page Dynamically to Head
- add_filter and remove_filter added before and after wp_query
- How to modify post content before writing to database?
- Is it possible to create an action hook using do_action() within add_action()?
- Hook for post permalink update
- Dynamically Override Fancy Title
- What is the difference between these two methods of writing $ instead of jQuery in WordPress [closed]
- Define a function outside a class and call the function using action or filter hook
- What function to hook for changes made in status and visibility of a post
- Synchronize Custom post type tags to WordPress default posts tags
- Woocommerce – Hide a Column in Cart Table
- Should action callbacks start with a verb?
- WordPress after content Hook & external template part
- Namespaced action and filter tags
- best practice for query string values – get_query_var always empty for my value supplied in query string
- get_current_screen() return null
- Prefixing plugin hooks (actions/filters) with a wrapper class or functions
- How to get all queries’s results after they have executed?
- WP Plugin Running before jQuery
- Remove an action by extending class and replacing it
- Add child pages to submenu automatically
- hook filter after the_content on a specific page
- Bind a function with its own argument to show something dynamically after every content
- Why enqueue styles on hook?
- Hook add_attachment error
- Call to undefined function is_home() or any conditional tags
- WooCommerce change Tax Class programmatically when Recalculating an existing Order [closed]
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Update variable value via add_filter
- Using function from enqueued .js file in theme in plugin?
- Configure WordPress to Generate Scheme-less Relative URLs
- How to find list of all functions bind to a particular hook from my plugin?
- Ajax +wordpress onClick link redirect to new page and create html content
- How to replace settings in WordPress plugin from a theme
- apply_filters() and call_user_func() to define and call a function outside a class
- Override category archive page title (not the head title)
- Limit get_next_post to posts from the same author
- Any way, hook to add content right before the “read more” link?
- WordPress Plugin Boilerplate – add actions and/or filters based on user’s role
- Add_action not calling callback function
- replacing jquery google cdn with a new version dynamically
- Caption Shortcode: what filter to change the image size?
- Template file structure , wordpress hook for altering the template
- WordPress permalink setting
- How do I replace title with my plugin?
- append code after the_content not working
- Loading jQuery library from WordPress admin
- how to insert content into wp_head after loop_end
- Apply function on all action hooks?
- How to get the value entered in the input field in wordpres
- How react js and other Javascript Technologies works on WordPress plugin?
- Ninja Forms: Front-End Forms, Post ID?
- Which hook should be used to add an action containing a redirect?
- Where to store PHP files created by plugin / themes
- How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
- What is better way to use Bootstrap inside admin panel?
- Determine plugin name from within plugin_action_links filter
- Best Practices for Creating and Handling Forms with Plugins?
- Is Dreamweaver CS5 a serious choice for theme/plugin development?
- What allows a template file from plugin to be copied in child theme and overridden?
- add_filter : Passing an array instead of the callback function?
- WordPress security issue to output data from user input from theme option form
- Customizer: widget-synced triggers twice
- how to add Jquery script to one page?
- Is there an event or an other method that tells me the preview is loaded?
- .mo translation strings not loading in PHP scripts that handle AJAX calls
- Trying to understand order and frequency of action hooks firing
- Are there any scripts, classes, and/or functions built-in to WP for a plugin to export/import its saved data from wp_options?
- How to access noticeOperations from withNotices
- How to get boolean value from register_meta properly?
- Can’t get woocommerce_get_price_html to work [closed]
- jQuery selectors for editor elements safe to use?
- Strange Situation When Try To Retrieve Github Gist Using wp_remote_get
- template_redirect or admin-ajax.php?
- making a plugin that moves other plugins wp_head actions to wp_footer
- How to resize WordPress images on upload to specific height and width without cropping it
- Restrict certain actions to plugin-specific admin menu pages only
- Adding tables to dashboard pages programmatically?
- Pass custom props to
- Include external po file for 3th party plugin to theme
- Why does do_action pass a blank string as the first parameter if no $arg is set?
- Hook for validating and rejecting frontend image upload
- Determine if the current page, is being edited
- Looping single post in a theme
- Custom theme and plugin updating
- grouping my widgets wordpress
- If I want to create new taxonomies (e.g. Project / Documents / Etc…) is it better to create them in the theme’s functions.php or within a plugin? [duplicate]
- How to add something after a function
- how many rupee or dollar charge to client to make theme [closed]