0

I've a custom post type and a custom taxonomy assigned to it. I'm trying to get the categories to display in following manner.

Use: When you hover on the Parent category with child items it should display child items and the same for sub items for child category.

enter image description here

I tried using wp_list_categories() function but it returns the list in following order.

enter image description here

How do I get this to match the screenshot 1 layout?

Thanks.

shutupchigo
  • 703
  • 1
  • 7
  • 19

1 Answers1

0

Using recursion it is possible to build the tree like parent->child structure to any level. You might need to build that custom function. Have a look at the below example which uses recursion.

Creating a recursive category tree function

Krishnadas PC
  • 5,981
  • 2
  • 53
  • 54