Title: Nested loop
Last modified: August 20, 2016

---

# Nested loop

 *  [801red](https://wordpress.org/support/users/801red/)
 * (@801red)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/nested-loop/)
 * I’ll apologize early on for my lack of knowledge and experience…I’m learning 
   as I go.
 * I have a site with 4 “home” pages; we’ll call them North, South, East and West.
   Each of those pages will have the same categories, but the content needs to be
   specific to each home. For example: they will each have content categorized as
   News, Member and Feature.
 * The way that makes sense, to me, is to have `<?php if (is_page('north')): ?>`
   and have the main loop query all “North” category posts, and then nested loops
   to query all “News” “Member” and “Feature” category posts. That way, the only
   post to show up in the News area is one categorized “News” AND “North”…and then
   repeat the process for the other three home pages.
 * Thoughts? Am I making it far more difficult than need be? I tend to do that…

Viewing 1 replies (of 1 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/nested-loop/#post-2785901)
 * something to read:
 * [http://codex.wordpress.org/Class_Reference/WP_Query](http://codex.wordpress.org/Class_Reference/WP_Query)
 * [http://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters](http://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters)
   
   use the ‘category__and’ parameter
 * [http://codex.wordpress.org/The_Loop#Multiple_Loops](http://codex.wordpress.org/The_Loop#Multiple_Loops)
 * possibly
    [http://codex.wordpress.org/Pages#Page_Templates](http://codex.wordpress.org/Pages#Page_Templates)

Viewing 1 replies (of 1 total)

The topic ‘Nested loop’ is closed to new replies.

## Tags

 * [multiple categories](https://wordpress.org/support/topic-tag/multiple-categories/)
 * [nested loop](https://wordpress.org/support/topic-tag/nested-loop/)
 * [the-loop](https://wordpress.org/support/topic-tag/the-loop/)

 * 1 reply
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/nested-loop/#post-2785901)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
