I have a taxonomy-types.php set up with a custom post type (Products) and on this page I want to display different content depending on what level (hierarchical) taxonomy is currently being displayed, which are like this;
– – Blue
– – Red
– – Children’s
– – Seaside
– – Purple
– – Orange
I have 3 levels of taxonomy (above) and I just need to test whether the current taxonomy has;
1. Has no parent but has a child (level 1)
2. Has both a parent and a child (level 2)
3. Has a parent and no child (level 3)
This will give me the three different levels and depending on what level the visitor is currently in, I’ll display something different on the page.
I hope that makes sense, any help would be much appreciated. Thank you!
- The topic ‘If current taxonomy has child and/or parent’ is closed to new replies.