Title: Multiple Pages with Multiple Posts from Multiple Categories?
Last modified: August 18, 2016

---

# Multiple Pages with Multiple Posts from Multiple Categories?

 *  [dcochran](https://wordpress.org/support/users/dcochran/)
 * (@dcochran)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/)
 * Is it possible to have multiple pages (or sections of the wordpress site) that
   display posts from multiple categories? My index does it great. I’ve used multiple
   versions of the loop in the index.php, each loop configured to display posts 
   from a specific category.
 * Now I want other pages in the site that can do it, too.
 * We’re building a college student website. I would like for each major section
   of the site to be able to be laid out like we’ve laid out the current index page,
   with posts from this category in one spot, posts from another category in another,
   and so on.
 * [http://okwueagle.com/](http://okwueagle.com/)

Viewing 15 replies - 1 through 15 (of 23 total)

1 [2](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/page/2/?output_format=md)

 *  [bryan868](https://wordpress.org/support/users/bryan868/)
 * (@bryan868)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/#post-521066)
 * You’d basically do the same thing that you did in your index.php. Just create
   static .php files: academics.php, campus.php, etc., and insert your multiple 
   loops to achieve the desired effect. That’s how I’d approach it.
 *  Thread Starter [dcochran](https://wordpress.org/support/users/dcochran/)
 * (@dcochran)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/#post-521111)
 * Thanks. I’m trying that out. I’m having trouble.
 * I’ve created a stepup.php based on index.php and saved it in the same theme folder
   as my functioning index.php.
 * I have two problems:
 * 1) The URL to get to this file is very long and unwieldy.
 * 2) The template tags aren’t connecting to the database. I get an error on each
   bloginfo item in the head … and so I got read of those, replacing them with straight
   code. Now it gets to the loops, but the loops aren’t working. I get error messages
   every time.
 * > `Fatal error: Call to undefined function: have_posts() in /home/.pause/okwueagle/
   > okwueagle.com/wp-content/themes/okwueagle-spring07/stepup.php on line 14`
 * Here’s [the URL to this file](http://okwueagle.com/wp-content/themes/okwueagle-spring07/stepup.php).
 * [http://okwueagle.com/wp-content/themes/okwueagle-spring07/stepup.php](http://okwueagle.com/wp-content/themes/okwueagle-spring07/stepup.php)
 * How can I solve these two issues?
 *  Thread Starter [dcochran](https://wordpress.org/support/users/dcochran/)
 * (@dcochran)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/#post-521362)
 * Just checking back — Is there a way to do this?
 *  Thread Starter [dcochran](https://wordpress.org/support/users/dcochran/)
 * (@dcochran)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/#post-521421)
 * Did I stump the community?
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/#post-521422)
 * I guess nobody really understands what you want – at least I don’t. So, instead
   of bumping just try to clarify what are the “multiple” pages. Until we understand
   the structure of your content… nobody will be able to say anything that would
   make sense.
 *  [nhlline](https://wordpress.org/support/users/nhlline/)
 * (@nhlline)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/#post-521423)
 * I think I get what he wants. You know how your front page shows multiple posts,
   usually the 10 most recent, and then you can click previous pages for more, can
   you have this for ALL pages throughout your website?
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/#post-521424)
 * nhlline,
    you are making it it even more confusing 🙂 If you visit the OP’s WP
   install – there is nothing similar to what you said.
 *  [nhlline](https://wordpress.org/support/users/nhlline/)
 * (@nhlline)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/#post-521425)
 * Can you make a page with more than one post? That simple.
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/#post-521426)
 * On a basic WP install – no. [Pages](http://codex.wordpress.org/Pages) (if we 
   are talking about the same thing!) are meant to display ONE entry from the DB.
 *  [nhlline](https://wordpress.org/support/users/nhlline/)
 * (@nhlline)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/#post-521427)
 * Yes thats what I’m talking about. Thanks for clearling that up but why not, it
   would make wordpress that much better. And please refer to my post on “WordPress
   2.1” I have a question in there that is frustrating me to no end.
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/#post-521428)
 * 29 minutes (the time since you posted that topic) is nothing… in terms of WP 
   forum. When you didn’t get an answer for 24 hours – you may start thinking why
   people didn’t get it, and add some more info 🙂
 *  [nhlline](https://wordpress.org/support/users/nhlline/)
 * (@nhlline)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/#post-521429)
 * lol Thanks for the info
 *  Thread Starter [dcochran](https://wordpress.org/support/users/dcochran/)
 * (@dcochran)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/#post-521430)
 * Thanks to all for jumping back in here with me.
 * To try to make it more specific:
 * My current index.php places posts of category sub-features within a sub-features
   div which I position in the top left sidebar. Under that I have a loop pulling
   posts of category announcements. Then I have a loop pulling posts of category
   features, which I’ve positioned at the top of the center column. Under features
   is a loop pulling posts from the category Homepage Highlights … and on it goes.
 * Now I want MORE such files, in which I pull posts from multiple categories and
   place them in various places on the same web page. I do not need to create these
   as WordPress pages. I only want to be able to make a copy of index.php and change
   up the categories of the posts which get pulled in by the various loops.
 * Besides index.php, I would like to have campus-life.php that does this, and academics.
   php, and eventually more. Each of these would have a complex layout, like my 
   current index.php — placing posts from various categories in various places on
   the web page.
 * I’ve tried this, but the loops don’t work. And when I place the file in the theme
   folder, the URL goes to the file in the theme folder (which is extraordinarily
   long and awkward), and the loops still don’t work.
 * Is there a way to tell wordpress to treat these new multi-category template files
   like it treats index.php? — connecting it to an address on the main site structure(
   i.e., [http://okwueagle.com/campus-life.php](http://okwueagle.com/campus-life.php))—
   and allowing it to pull posts from multiple categories into various places in
   the same page?
 * By the way, there is no 404 page working yet (I’m working on that), and so when
   you go to a page that isn’t there, you get the index:
 * [http://okwueagle.com/](http://okwueagle.com/)
 *  Thread Starter [dcochran](https://wordpress.org/support/users/dcochran/)
 * (@dcochran)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/#post-521431)
 * And so to clarify, what I get when I try to do this as bryan868 first suggested
   [is this](http://okwueagle.com/wp-content/themes/okwueagle-spring07/stepup.php).
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [19 years, 3 months ago](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/#post-521432)
 * Okay, you cannot connect *directly* to a theme file like that. There’s your first
   mistake.
 * What we’re trying to figure out is how yowant people to actually access these
   extra loops. Where are they going to be? How are you wanting to link to them?
 * You said _I do not need to create these as WordPress pages._, but in point of
   fact, yes, actually you do. Only WordPress pages can access WordPress data.
 * If these extra php files you made have Loops in them that explicitly use get_posts
   or WP_Query or whatever to get what posts they want and such, then you should
   be able to simply turn them into Page Templates and then create new Pages (which
   will be empty) which use those Page templates. Then they will be accessible as
   standard WordPress pages.
 * First read this:
    [http://codex.wordpress.org/Pages#Creating_your_own_Page_Templates](http://codex.wordpress.org/Pages#Creating_your_own_Page_Templates)
 * Next, turn one of your php files into a Page Template by adding the appropriate
   header to it.
 * Then, create a new Page using Write->Page.
 * Select your template on the right.
 * Publish.
 * Your Page will now be accessible at [http://example.com/Pagename](http://example.com/Pagename).
 * _Is there a way to tell wordpress to treat these new multi-category template 
   files like it treats index.php? — connecting it to an address on the main site
   structure (i.e., [http://okwueagle.com/campus-life.php](http://okwueagle.com/campus-life.php))—
   and allowing it to pull posts from multiple categories into various places in
   the same page?_
 * See, you’re confused about the way wordpress works. It doesn’t magically turn
   links on the main site into links in the theme folder. The index.php on the main
   site *actually exists*. It loads the blog. In point of fact, it *always* loads
   the blog, regardless of what the URL is in the address bar. It uses URL rewriting,
   and the content of the address does not refer to the actual directory structure
   of the site in any way at all.
 * Forget the old ways you know about putting html in folders and building a folder
   structure to create different URLs. WordPress does not work that way.

Viewing 15 replies - 1 through 15 (of 23 total)

1 [2](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/page/2/?output_format=md)

The topic ‘Multiple Pages with Multiple Posts from Multiple Categories?’ is closed
to new replies.

## Tags

 * [loops](https://wordpress.org/support/topic-tag/loops/)
 * [templates](https://wordpress.org/support/topic-tag/templates/)
 * [Themes](https://wordpress.org/support/topic-tag/themes/)

 * 23 replies
 * 6 participants
 * Last reply from: [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * Last activity: [19 years, 3 months ago](https://wordpress.org/support/topic/multiple-pages-with-multiple-posts-from-multiple-categories/page/2/#post-521440)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
