Hey guys i am new to wordpress and was wondering how to Display only top child of parent. What i mean by that is, let’s say
Movies is the top category and the child of that is Disney, Pixar etc and the child of Disney is Action and Pixar is also Action
On movies category i only want to display Disney, and Pixar not Action
So lets put it like this:
Movies - Main
-Disney (Displayed in Movies Category)
--Action NOT DISPLAYED
-Pixar (Displayed in Movies Category)
--Action NOT DISPLAYED
but wordpress automatically displays it. how would I fix this?
For this you’ll have first to get all top categories using
get_categories
and then get all categories that have each of the top categories as parent: