Limit Posts Per Page to 10 instead of Infinite

  • Author
    Posts
  • #1255660

    Hey Guys,

    I’m trying to limit the amount of posts per page on my website. Currently when you type something in the search bar it lists every post from the beginning of time. I’d like it to be 10. Here’s how my code reads:

    <?php if (have_posts()) : ?>
    <div id="left" class="pageContentArea">
    <article class="post">
    <h1>Results for '<?php the_search_query(); ?>'</h1>
    <?php include (TEMPLATEPATH . '/_/inc/post/nav.php' ); ?>
    <?php while (have_posts()) : the_post(); ?>
    <article <?php post_class() ?> id="post-<?php the_ID(); ?>">
    <h2>"><?php the_title(); ?></h2>
    <div class="entry">
    <?php the_excerpt(); ?>
    </div>
    </article>
    <?php endwhile; ?>
    <?php include (TEMPLATEPATH . '/_/inc/post/nav.php' ); ?>

    Do you have any reccommendations on what I need to add in order to achieve this?

    #1255913

    supportbot
    Member

    You did not specify a blog address or reason for posting when you created this topic.

    This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you’ll find help at the WordPress.org forums.

    If you don’t understand the difference between WordPress.com and WordPress.org, you may find this information helpful.

    If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.

    This is an automated message.

The topic ‘Limit Posts Per Page to 10 instead of Infinite’ is closed to new replies.