WordPress.org

Support

Support » How-To and Troubleshooting » Find out the CategoryID of a selected item in a Dropdown List

Find out the CategoryID of a selected item in a Dropdown List

  • I want to make a conditional dropdown list that displays the Child Categories of a selected Parent in a previous dropdown list.

    So basically if a user chooses City from a dropdown list, I need a way of grabbing that Category ID and telling a second dropdown list to show the Towns within that City.

    So to the user it looks like this:
    [List of Cities] *choose* [List of Towns within that City]

    in the backend it’s this:
    [List of CategoryIDs] *choose* [Children of selected CategoryID]

    It would then go further.
    Using the ID of the selected Child Category (in the second dropdown), I would then want to display a list of Posts within that Category ID.

    So to the user:
    [List of Cities] *choose* [List of Towns within that City] *choose* [List of Stores]

    In the backend:
    [List of CategoryIDs] *choose* [Children of selected CategoryID] *choose* [List of Posts within ChildCategoryID]

    So as far as I can tell I just need to be able to grab the CategoryID of a selected item, yes?

    Any help would be appreciated.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Find out the CategoryID of a selected item in a Dropdown List’ is closed to new replies.
Skip to toolbar