{"id":2785684,"date":"2012-06-01T17:34:03","date_gmt":"2012-06-01T17:34:03","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/nested-loop\/"},"modified":"2016-08-20T12:39:58","modified_gmt":"2016-08-20T12:39:58","slug":"nested-loop","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/nested-loop\/","title":{"rendered":"Nested loop"},"content":{"rendered":"<p>I&#8217;ll apologize early on for my lack of knowledge and experience&#8230;I&#8217;m learning as I go.<\/p>\n<p>I have a site with 4 &#8220;home&#8221; pages; we&#8217;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.<\/p>\n<p>The way that makes sense, to me, is to have <code>&lt;?php if (is_page(&#039;north&#039;)): ?&gt;<\/code> and have the main loop query all &#8220;North&#8221; category posts, and then nested loops to query all &#8220;News&#8221; &#8220;Member&#8221; and &#8220;Feature&#8221; category posts. That way, the only post to show up in the News area is one categorized &#8220;News&#8221; AND &#8220;North&#8221;&#8230;and then repeat the process for the other three home pages.<\/p>\n<p>Thoughts? Am I making it far more difficult than need be? I tend to do that&#8230;<\/p>\n","protected":false},"template":"","class_list":["post-2785684","topic","type-topic","status-closed","hentry","topic-tag-multiple-categories","topic-tag-nested-loop","topic-tag-the-loop"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2785684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2785684\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=2785684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}