WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Show 1 post on index and multiple on inner page (5 posts)

  1. dizzyvapor
    Member
    Posted 5 years ago #

    My blog is setup to show only one post at a time on the index page, which is how I want it. I am creating an inner page where I want to show all posts within a certain category, yet it's only showing the most recent post from that category. How do I override the settings I have so that the inner page shows all posts in that category rather than 1 post like the homepage does?

  2. tslice
    Member
    Posted 5 years ago #

    Not sure if this is the answer you're looking for, but you will most likely have to edit your theme and use a wp function:

    http://codex.wordpress.org/Template_Tags/get_posts

  3. MichaelH
    Member
    Posted 5 years ago #

  4. dizzyvapor
    Member
    Posted 5 years ago #

    Thanks, I actually found a loop to display just one on the homepage before checking back here. Shouldn't have gave up on searching for an answer so soon.

    One problem arises though which might need a new forum post.. I'm using this code on the homepage AND I want to exclude one category from ever showing up on the homepage

    <?php query_posts('posts_per_page=1');?>

    however when I add the code below somewhere, it does exclude that category but it also shows multiple posts again

    <?php
       if (is_home()) {
          query_posts("cat=-3");
       }
    ?>
  5. dizzyvapor
    Member
    Posted 5 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic