Nest Category parents in loop
-
The following code allows me to output all posts organized by their category like so:
- Subcat 1
- A post
- Another post
- Subcat 2
- Yet another post
- And another
- Subcat 3
- A fifth post
- And a sixth
I have accomplished this with the following loop:
My question is: how can I further nest the loop, so that the subcategories are grouped by their parent category? Like so:
- Parent Cat 1
- Subcat 1
- A post
- Another post
- Subcat 2
- Yet another post
- And another
- Parent Cat 2
- Subcat 3
- A fifth post
- And a sixth
ANY help with this would be greatly appreciated! I’ve been working on this thing for 13 hours straight and I’m starting to feel like I might stroke out at any moment. 8-0
- The topic ‘Nest Category parents in loop’ is closed to new replies.