WordPress.org

Support

Support » How-To and Troubleshooting » Paging is just showing the repeat of first page posts

Paging is just showing the repeat of first page posts

  • vikkineal
    Member

    @vikkineal

    Hi can anyone help?

    I’ve set up category-5.php to show all posts assigned to it and none of category-4.php posts.

    The trouble is that the paging doesn’t seem to be working – not sure if that’s related or not – but it’s only showing the same set of posts (that are in category 4).

    Any ideas what I’m doing wrong?

    Thank you 🙂

    <?php get_header(); ?>
    
    <div class="clearBoth"></div>
    <div class="container clearFix">
    <div class="articles">
      <?php
    $args = array( 'category_name' => 'Project Portfolio' );
    $lastposts = get_posts( $args );
    foreach($lastposts as $post) : setup_postdata($post); ?>
      <div class="grid_5">
        <a href="<?php the_permalink(); ?>">
        <?php the_post_thumbnail('portfolio-category'); ?>
        </a>
      </div>
      <div class="grid_7">
        <h3><?php the_title(); ?></h3>
        <p><?php the_excerpt(0,200); ?></p>
        <p><a href="<?php the_permalink(); ?>">Read more</a></p>
      </div>
      <div class="clearBoth"></div>
      <hr />
      <?php endforeach; ?>
    </div>
    <div class="paging">
      <?php posts_nav_link('&nbsp;','<','>'); ?>
    </div>
    <?php get_footer(); ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Paging is just showing the repeat of first page posts’ is closed to new replies.