Pagination Doesn’t Work Within Page Posts
-
Hey,
I am having a funny problem with pagination on my website.
I am using the “exec php” plugin on the BigFeature theme to allow php code on my wordpress pages. Then I’m using the wp query function to pipe in specific posts and display them on my pages.
I read that there was a problem with pagination when using custom queries, and I so I used this code to fix it:
<h3>Recent Articles</h3> <ul> <?php $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query('showposts=5'.'&paged='.$paged); ?> <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li> <?php endwhile; ?> </ul> <div class="navigation"> <div class="alignleft"><?php previous_posts_link('« Previous') ?></div> <div class="alignright"><?php next_posts_link('More »') ?></div> </div> <?php $wp_query = null; $wp_query = $temp;?>
But now, the page navigation is not showing up at all. I’m just getting five posts and then nothing(example): https://www.remainnameless.org/resources/artists/
Any ideas? Thanks!
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Pagination Doesn’t Work Within Page Posts’ is closed to new replies.