Need help? Check out our Support site, then


Limit Posts Per Page to 10 instead of Infinite

  1. ryanmschilling
    Member

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

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

  2. 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.

Topic Closed

This topic has been closed to new replies.

About this Topic