• Resolved patdryburgh

    (@patdryburgh)


    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

    (@patdryburgh)

    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.