• Resolved anderskitson

    (@anderskitson)


    For the code below how would I limit the amount of posts shown to 3?
    UPDATE
    Found what I needed to do I needed to add this line
    <?php query_posts(‘posts_per_page=1’);?>my while loop.

    <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
    <? if ($post->ID != $featured_ID) { ?>
    <h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <small>on <?php the_time('M d'); ?> in <?php the_category(', '); ?> tagged <?php the_tags(''); ?> by <?php the_author_posts_link(); ?></small>
    <?php the_excerpt(); ?>
    <div class="separator biggap"></div>
    <? } ?>
    <?php endwhile ?>
     <?php endif; ?>

  • The topic ‘Limit While have_posts to 3 posts’ is closed to new replies.