next/prev posts links not working
-
I’m trying to figure out how to create prev/next navigation after a series of the three latest posts — “previous” and “next”. I know it involves the $paged function somehow but I can’t quite figure it out. Right now the next/prev post links are not showing up at all.
Here’s what I have:
<?php $counter = 3; $recentPosts = new WP_Query(); $recentPosts->query('showposts=3'.'&paged='.$paged); ?> <?php query_posts('category_name=spotlight'); while ($recentPosts->have_posts()) : $recentPosts->the_post(); ?> <div id="postsection" class="section"> <?php if ( has_post_thumbnail()) : ?> <div class="postphoto"> <?php the_post_thumbnail();?> <div class="slidedate">Aug 2nd, 2011</div> <div class="slidetitle"><?php the_title(); ?></div> </div> <div class="posttext"><?php the_content(); ?></div> <br class="clear" /> </div> <?php endif; ?> <?php endwhile; ?> <?php previous_posts_link('« Previous') ?> <?php next_posts_link('More »') ?> </div>
Any help would be really appreciated for this PHP noob.
Viewing 14 replies - 1 through 14 (of 14 total)
Viewing 14 replies - 1 through 14 (of 14 total)
- The topic ‘next/prev posts links not working’ is closed to new replies.