Parent and child relation code and display only first child list
With get_term_children you are retrieving a flat array of all child terms. What you want is an array with only the first child terms. Unfortunately there is no immediate way to retrieve this, so it has to be done in two steps: $parent_term = get_term_by(‘slug’, ‘bedroom’, ‘your_taxonomy_slug’); This gives you the ‘bedroom’ taxonomy term. Now … Read more