How to show all posts in a category page? (5 posts)

  1. u02811
    Posted 10 years ago #

    hi all, i've configured only certain categories of posts to appear on my index.php. now, i want to also have a specific page to show ALL my posts (not index.php, because i've uses for that already)

    is there a snippet of code to show ALL posts in perhaps a 'page' or category page? i tried to do the_loop using runPHP but it doesnt seem to work.

    can anybody point me in the right direction? thanks!

  2. moshu
    Posted 10 years ago #

    You don't need any "special code" for that.
    WP does it out of the box: it uses archive.php to display the monthly or category archives <-- this one is the listing of all posts from a certain category. By clicking on a category name you should be able to see all the posts in that category.

    If you want some fancy different look, you can use the Category_Templates.
    ALso, to understand how the template files are used in WP, see Template_Hierarchy.

  3. u02811
    Posted 10 years ago #

    hi moshu, thanks for replying. =)

    i understand that category.php can do that. i've already implemented category to help me handle showing all posts within a category..

    however i'm still not too sure about showing all posts (all categories) .. how am i going to modify the code for it, and how am i going to decide what page url to show it under?

  4. jfriesen
    Posted 9 years ago #


    Place something like this before your loop:

    <?php query_posts('category_name=Cat Name&showposts=999'); ?>

    Hope that helps!

  5. moshu
    Posted 9 years ago #

    And also post the URI of that site so we can avoid it - I'd hate to open a webpage with 999 posts on it :)

    Why not use the prev/next posts links?

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.