Forums

How to list all posts when viewing category.. (5 posts)

  1. Dirt2
    Member
    Posted 2 years ago #

    For my main blog index I only want the selective amount of blogs to show but I want all the blogs to show when you are viewing the individual category, Is there a plugin for this? I've looked and can't seem to find what I want. Help appreciated, thank you.

    A2

  2. maorb
    Member
    Posted 2 years ago #

    you may use the function for your homepage, just before the loop -
    query_posts('showposts=n');
    where n is the number of posts to show.

    Be sure to include it in the home.php file, to affect only the homepage.
    If you don't have such a file, copy the index.php and rename it to home.php and then make the change.

    About template Hierarchy - http://codex.wordpress.org/File:Template_Hierarchy.png

    About query_posts - http://codex.wordpress.org/Template_Tags/query_posts

  3. Dirt2
    Member
    Posted 2 years ago #

    I only want my categories to be affected though, My index page is fine.
    And why does it need to have a home.php page, I've never seen a template use home.php instead of index.php?

    Edit: Right now I am using the code (you provided) on my index and displaying a limited amount of posts for only the index and I've changed the default number to 100 so it will display 100 or so posts for everything except the index, which is fine.. Is this what you were suggesting? It seems to work fine without having to create a home.php page as well.

    Edit 2: Actually my pagination broke if I used it on my index.. Gave me an error when you click previous page.

    Thanks

  4. maorb
    Member
    Posted 2 years ago #

    Well, if you have an archive.php or category.php, so you don't really need to create a home.php in your case.
    It's just there are templates with none of these files, and the index.php becomes responsible to all categories and archvies as well.
    If your template wouldn't have a category.php or archive.php, and you would have made this change to the index.php, it would have been affeting your categories as well, thus why I suggested ..

  5. Dirt2
    Member
    Posted 2 years ago #

    Do you know of a method that won't give me that error?

    Thank you

Topic Closed

This topic has been closed to new replies.

About this Topic