How to display conditional child category menu
-
Hi. I’ve been searching around on the forums and Google, but haven’t found an answer to this yet (I might be using the wrong keywords).
I would like to code into the template a conditional statement that effectively says, if this category has children, list the children (as LIs in a MENU), AND/OR if this category is a child, list it and the other children of the same parent. If the conditions return false–if the cat is neither a parent nor a child, just a bachelor category :-), don’t show anything.
It sounds so easy, and I HAVE been able to make it work with pages, but I can’t nail the category part–at least, not without hardcoding the category ID into the template, which I don’t want to do.
Could someone please give me the code I’d need to use?
Thank you!
- The topic ‘How to display conditional child category menu’ is closed to new replies.