• Here’s my goal: I want the main page (index.php) to have the most recent X posts of one category, and then I want to create Pages with modified versions of The Loop that will show the most recent X posts of their own specific categories. (That is, Page A will only display posts from Category A, Page B will show posts from Cat B, and so on.) However, if I exclude categories from The Loop, it still brings up my post count and my Pages (and index.php) will only show a couple of posts.

    The Loop’s entry on the WP Codex says “If this is a problem for you, there is more complicated hack you can employ described in the Layout and Design FAQ.” Is this referring to the my-hacks.php addition? How would I apply that hack to the other Pages? Is it even the right solution to my problem? I’m not quite sure what to do here.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Why don’t you use category.php templates for displaying posts from a certain category? I mean in the case you want them to be different. Otherwise wouldn’t the archive.php do the job to display posts from only the selected category?
    (Pages aren’t really meant to display posts…)

    Thread Starter danbruno

    (@danbruno)

    Okay, I figured out a way to do what I want. I made a template file that uses PHP to include index.php, so that I can make pages that mimic the home page (as moshu said, not quite the intended use, but oh well ?? ). Then I used conditional tags to figure out which page is being looked at, and used query_posts to specify what I wanted done (including how many posts to show).

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Different categories on each page / Showing the right number of posts’ is closed to new replies.