• 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
    1. Apples
    2. Bananas
    3. Peaches
    • Toys
    • Cars
    1. Ferraris
    2. 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]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘list current cat's child cats' posts with nesting’ is closed to new replies.