list current cat's child cats' posts with nesting
-
Hi there guys – I’m using some code I found which list the current category’s child categories and their posts within each category. I’m pulling in custom fields from each post. What I want to do is update this code to allow me to style my category titles to differentiate between child categories and child-child categories. So for example, if my categories are like this structure:
- Food
- Fruit
- Apples
- Bananas
- Peaches
- Toys
- Cars
- Ferraris
- Porsches
I want to ‘print’ a different
li
class for my 3rd level categories, like ‘Apples’. My code currently treats all category titles the same, but I want to be able to print something different if it’s a child-child category – like ‘Apples’ – so I can style the title differently. How can I tell in the code if it’s a child-child category? I hope that makes sense, it’s all a bit confusing.[Code moderated as per the Forum Rules. Please use the pastebin]
- The topic ‘list current cat's child cats' posts with nesting’ is closed to new replies.