Query Posts Creating Problem With Next Archive Page
-
Right now I’m telling the code to pull up two posts per archive page in my portfolio category. But when I click the older entries button it doesn’t find the other posts in that category, it displays an error page. Any help? I need to get the other posts to show when I click older entries.
<?php get_header(); ?> <div id="portfolio_content"> <!-- Grab posts --> <?php if (query_posts('posts_per_page=2')) : ?> <?php while (have_posts()) : the_post(); ?> <div style="width:980px; background:#000"> <div class="img"> <a href="<?php the_permalink() ?>"> <?php $image = catch_that_image(); if( $image ) { ?> <img src="<?php echo $image; ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>, <?php comments_number('No comments','One comment','% comments'); ?>" /> <?php } ?> </a> <div class="title"><?php the_title(); ?></div> <div class="desc">Add a description of the image here</div> </div> </div> <?php endwhile; ?> <?php endif; ?> <!-- Next/Previous Posts --> <div class="mp_archive"> <div id="more_posts"> <div class="oe"><?php next_posts_link('« Older Entries') ?></div><div class="re"><?php previous_posts_link ('Recent Entries »') ?></div> </div> </div> </div> </div> <?php get_footer(); ?>
- The topic ‘Query Posts Creating Problem With Next Archive Page’ is closed to new replies.