R
R
Raymondy2016-11-25 00:58:29
Taxonomy
Raymondy, 2016-11-25 00:58:29

Dropdown list of wordpress categories?

Comrades, how can I make a drop-down menu with categories and next, to the right, the same drop-down menu with subcategories for the selected category in the first drop-down list? And you need to display it above the list of products on the WP store page.
Something like on the site redpower(dot)ru, only without the find button. The search should start automatically after selecting a subcategory from the second dropdown list.
Maybe someone will tell you in which direction to dig and where to think)
I'm ready to consider the solution of this task on a turnkey basis for a fee.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Vorotnev, 2016-11-25
@HeadOnFire

There are 2 options:
1. When loading the page through wp_localize_script, output json to the document with the entire category structure, build the first select using PHP in the usual way, and build the second select by choosing the first select using javascript. Pulling values ​​into the second select will be instantaneous.
2. When loading the page, build only the first select, when choosing a value, send a request to the server with Ajax and receive child elements, which will be displayed in the second select.
Well, by choosing a value in the second select using javascript, start the search.
PS: Although the Toaster is not an exchange for finding performers, but if you can’t do it yourself, contacts are in the profile.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question