Limit Posts Per Page to 10 instead of Infinite

  • Author
  • #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(); ?>
    <?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?



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

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

    If you don’t understand the difference between and, 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.