• Hiya

    I’m building a website based using wordpress.

    I’ve got a ‘latest news’ page which redirects to the post category ‘latest news’.

    All of my posts are given the category ‘latest news’, so as thou can imagine, after a while, this page will become really long.

    How can I add paging to the category page to only show 5 posts per page?

    Here is my code…any pointers would be greatly appreciated.

    <div id="rightColumn">
        <?php if(have_posts()) : ?>
        <?php while(have_posts()) : the_post(); ?>
        <div class="newsResultsPanel post">
          <div class="imgContainer"><a href="<?php the_permalink(); ?>"><?php echo get_the_post_thumbnail($post->ID, 'size-1'); ?></a></div>
          <div class="copyContainer">
            <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
            <h3><?php the_time('F jS, Y') ?></h3>
            <div class="entry">
              <?php the_excerpt(); ?>
            </div>
            <div class="clearBoth"></div>
            <p class="readMore"><a href="<?php the_permalink(); ?>">Read more ?</a></p>
          </div>
          <div class="clearBoth"></div>
        </div>
    
        <?php endwhile; ?>
        <?php endif; ?>
    
      </div>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add paging to category page’ is closed to new replies.