WordPress.org

Ready to get started?Download WordPress

Forums

I need 5 posts on home page, but ALL the posts to show in each category (3 posts)

  1. keeperbay
    Member
    Posted 5 years ago #

    I did a few searches, but I must be way off on keyword-age!

    I need the home page to show only the newest 5 posts. I need each category when clicked to show every post. Is there anyway to do this?
    I know that seems like a lot, but I use the blog for charity only, there are never more than 25 posts per category and people keep missing the little link at the bottom that reads “Next Entries.” And of course I don’t want to overwhelm people when they visit the blog with 400 posts first thing.

    Or maybe is there a Featured Category plug in that puts only the posts in the featured category on the home page? Something I could set to 5 separate from rest of categories. That way I could just change the 5 day to day and leave wordpress set at 25 post per page.

  2. kwbridge
    Member
    Posted 5 years ago #

    On the home page use query posts before the loop and set it to show 5 posts. The rest of your pages will still show what you have in the settings - 25 or whatever you have.

    <?php query_posts('showposts=5'); ?>
    <?php while (have_posts()) : the_post(); ?>

  3. yatin_zwt
    Member
    Posted 5 years ago #

    I have used below code to show one category in homepage with fixed number of posts.

    <?php $my_query = "cat=3" . $np_pop_cat . "&showposts=5";
    $my_query = new WP_Query($my_query);
    while ($my_query->have_posts()) : $my_query->the_post();
    ?>

    But I have problem with next and previous entries for that category in home page.

    I want if user clicks on "Next", then it will shows next 5 post of tha category.
    If you are not getting my problem then tell me , I will describe in details.

Topic Closed

This topic has been closed to new replies.

About this Topic