Title: Loop within a loop
Last modified: August 20, 2016

---

# Loop within a loop

 *  [johnfotios](https://wordpress.org/support/users/johnfotios/)
 * (@johnfotios)
 * [14 years ago](https://wordpress.org/support/topic/loop-within-a-loop-3/)
 * I have a loop, getting all post titles in a category.
 * I then want to do a loop, within that loop, which gets all posts with a sub category
   of that category.
 * I be all like:
 * Title 1
    — Sub cat Title 1 — Sub cat Title 2 — Sub cat Title 3
 * Title 2
    — Sub cat Title 1 — Sub cat Title 2 — Sub cat Title 3
 * Title 3
    — Sub cat Title 1 — Sub cat Title 2 — Sub cat Title 3
 * Hope this makes sense :S
 * Just, can I do a loop inside another loop? Lol.

The topic ‘Loop within a loop’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [johnfotios](https://wordpress.org/support/users/johnfotios/)
 * Last activity: [14 years ago](https://wordpress.org/support/topic/loop-within-a-loop-3/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
