front-page wp-query pagination issue, repeating posts next_posts_link HELP.
-
Hello,
I have created a page called “home”. I have set that page as my front page.
I have then edited page.php in my theme so that it basically asks which page it is on and then runs the loop with a $wp_query in front of it so that the correct posts are dished out and paginated. This works perfectly on every page apart from the home page.
The home page dishes out the first page of posts perfectly but when clicking on next_posts_link the same posts are repeated again and again.
I have spent the last 3 hours trying to find a solution but I have not found one. If you can help me I’ll buy you a pint and a bag of crisps.
Here is the code I am using within page.php
<?php if ( is_page('home') ) { ?> <?php $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query('cat=-6&showposts=6'.'&paged='.$paged); ?> <?php get_template_part( 'loop', 'index' );?> <?php } ?>
Please help me, you’re my only hope.
Regards, Morgyface. x
- The topic ‘front-page wp-query pagination issue, repeating posts next_posts_link HELP.’ is closed to new replies.