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?
- How to customize password reset message page on success if no error in password reset
- Removed jQuery script from header.php , any problems?
- WP_NAV_MENU filter targets all menus
- Use options to control jQuery plugin
- Save temporary registration data
- Redirect returning users to a certain page?
- Thickbox in Plugin settings page?
- How to localize data array in plugin’s option page
- How to remove/replace current page template?
- WordPress dynamic widget by location?
- sanitizing/escaping plugin options
- Adding filter to the title without affecting the menu title
- Load php file with jquery in single.php
- Restrict certain actions to plugin-specific admin menu pages only
- How to validate inputs with filter in register_setting callback
- WordPress Page Reload Takes forever during theme development
- How do i remove the title from a specific page
- Can / should a widget plugin define its own Widget Area?
- How to get changed post title in my custom plug-in which fires when ‘save_post’ is called?
- Is there an action_filter hook to add content before the post title?
- Loading Images from Javascript on the Front End
- Adjust query on single
- Adding tables to dashboard pages programmatically?
- Setting a post’s category
- Using jQuery prepend() with file include
- rewrite_rules problem
- Using password protection to load different page elements?
- How to deal with different jQuery versions?
- Can I attach a plugin via my add_filter callback contents?
- Anyone using unzip_file successfully? It uploads the zip but doesn’t extract it!
- How can the_excerpt (or equivalent) be called on a category description?
- Get cat parameter from admin-ajax
- Why does website stretch and white space on load? [duplicate]
- Creating posts with links from a txt file
- Change the behaviour of a button
- WP_Query order posts by category
- Set the payment processor callbacks to a plugin