Title: posts_per_page displaying the incorrect number of posts
Last modified: August 19, 2016

---

# posts_per_page displaying the incorrect number of posts

 *  Resolved [patdryburgh](https://wordpress.org/support/users/patdryburgh/)
 * (@patdryburgh)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/posts_per_page/)
 * Hello,
 * I am attempting to display 3 posts on the homepage of a website I’m developing.
   When I enter the following code, however, it displays 6 posts rather than three.
   Colour me confused.
 *     ```
       <?php if ( is_home() ) {
       				$args=array(
       						'showposts' => 3,
       						'paged'=> 1
       					);
       				query_posts($args); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
       			<article class="grid_4">
       				<h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
       				<section class="entry">
       					<?php the_excerpt(); ?>
       				</section>
       			</article>
       			<?php endwhile; else: ?>
       			<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
       			<?php endif; } ?>
       ```
   
 * This is just the bare-bones of the code, to give you an idea of what I’m trying
   to do. Thanks in advance for your help!
 * – Pat

Viewing 1 replies (of 1 total)

 *  Thread Starter [patdryburgh](https://wordpress.org/support/users/patdryburgh/)
 * (@patdryburgh)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/posts_per_page/#post-1590068)
 * You know those moments where, after a couple of hours trying to wrestle with 
   a problem, you realize there was nothing wrong other than your own ignorance?
 * This is one of those moments. Sorry for wasting your time, WP community! 🙂

Viewing 1 replies (of 1 total)

The topic ‘posts_per_page displaying the incorrect number of posts’ is closed to
new replies.

## Tags

 * [posts_per_page](https://wordpress.org/support/topic-tag/posts_per_page/)
 * [the-loop](https://wordpress.org/support/topic-tag/the-loop/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [patdryburgh](https://wordpress.org/support/users/patdryburgh/)
 * Last activity: [15 years, 11 months ago](https://wordpress.org/support/topic/posts_per_page/#post-1590068)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
