Title: Pages with Posts
Last modified: August 20, 2016

---

# Pages with Posts

 *  [oderuyter](https://wordpress.org/support/users/oderuyter/)
 * (@oderuyter)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/pages-with-posts-1/)
 * Hi All,
 * I am creating a sport site that needs pages with posts on them – what I mean 
   is a page with details about a sports team and then have all the posts relating
   to them (already set as a category) to be posted below. There are approximately
   100 teams so needs to be easily replicated – can any one point me in the right
   direction?
 * Many Thanks

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [neilfoster](https://wordpress.org/support/users/neilfoster/)
 * (@neilfoster)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/pages-with-posts-1/#post-2592212)
 * I’ve got something like this setup on a couple of pages. Menu shows pages of 
   Team 1, Team 2, Team 3 etc. Each page shows only a specified category.
 * Required editing the page.php or loop.php to include a “if then” loop. If page
   ID#4 then show category ID#13…
 * I’ll try to get the URL and/or code to you…
 *  [neilfoster](https://wordpress.org/support/users/neilfoster/)
 * (@neilfoster)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/pages-with-posts-1/#post-2592214)
 * That code is inserted into a template php page like “blog.php” Then each page–
   Team 1, Team 2 etc. uses that template.
 *  [neilfoster](https://wordpress.org/support/users/neilfoster/)
 * (@neilfoster)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/pages-with-posts-1/#post-2592221)
 * [http://upstairsroom.net/test](http://upstairsroom.net/test)
 * Pets and Bears…. ( I know – silly example, but this was for someone else last
   week)
 * Bears show “Grizzly” posts… Pets show “dogs” post. Combo shows both. Blog shows
   all posts including dogs and grizzlys…
 *  [neilfoster](https://wordpress.org/support/users/neilfoster/)
 * (@neilfoster)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/pages-with-posts-1/#post-2592223)
 * I’ll post the code ASAP…
 *  [neilfoster](https://wordpress.org/support/users/neilfoster/)
 * (@neilfoster)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/pages-with-posts-1/#post-2592236)
 * [http://pastebin.com/944011S3](http://pastebin.com/944011S3)
 * This is the “blog” template based on WP twenty ten theme.
 * You’ll see the php code has been inserted into the standard page.php. You’ll 
   have to mod it to fit into your theme page.php. (or loop.php)
 * So basically I inserted the php code into the page.php so it would still look
   like the regular page when it prints to screen and named it “blog.php”. You can
   add/change/remove the bylines, etc…
 * Then each page, Bear, Pets, etc. or Team 1, Team 2, etc.. use the “blog” template.
 * The code sees the corresponding page ID# and Category ID# and printes to screen.
 *  [jester48](https://wordpress.org/support/users/jester48/)
 * (@jester48)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/pages-with-posts-1/#post-2592237)
 * 1) create each team as a category
    2) assign team post to a specific category,
   you can do it as multiple categories if the article applies to 2 more teams, 
   eg. tournament info, game scores, etc.
 * now, create a listing of all the teams(categories) and this becomes a reference
   to the “team” page, if you have other common categories you might want to create
   a parent/child category parent is “teams” and the child is “individual team name”
 * you can do it by copying index.php, or if your theme has an existing category.
   php use that instead, and renaming it teams.php and flag it to list only categories
   from the team parent category
    see here [http://codex.wordpress.org/Template_Hierarchy](http://codex.wordpress.org/Template_Hierarchy)
 *  [neilfoster](https://wordpress.org/support/users/neilfoster/)
 * (@neilfoster)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/pages-with-posts-1/#post-2592241)
 * Then to duplicate, copy/paste the
 * elseif – is_page (‘xx’) – cat = array(xx) line as many times as you need.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Pages with Posts’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 3 participants
 * Last reply from: [neilfoster](https://wordpress.org/support/users/neilfoster/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/pages-with-posts-1/#post-2592241)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
