Older Posts / Newer Posts Always Show Same Posts
-
I’ve seen “older / newer posts” problems elsewhere in the forums, but my issue doesn’t quite match any other I’ve seen. Here goes:
In a nutshell, the older / newer posts function is not working from my home page. The links are correct (for example, http://www.retroland.com/page/2/) but the page generated is exactly the same as the home page.
Interestingly, the older / newer function works perfectly on category, search, archive and tag pages… just not from the home page.
Possibly useful information: my category structure does *not* include a top-level category. My permalinks are set to %postname%. My front page is set to “Your latest posts.” I can find my way around php, but clear instruction is appreciated… I’m not an accomplished programmer, just someone who knows enough to mess things up if given the chance. 😉
Any and all advice is appreciated! Thanks in advance!
Matt
-
Sounds like your theme’s index.php template file contains a custom query that needs amending. Drop a copy of the file into the WordPress pastebin and post the pastebin url here. Perhaps someone will be able to spot the problem and suggest a solution.
Hi esmi — thanks for your response.
Thing is, I’m using a child theme of Twenty Ten — the child theme is using Twenty Ten’s index.php. I’ve uploaded it anyway, just in case:
http://wordpress.pastebin.com/HZBmY0E7
For fun, here is the loop.php I’m using in my child theme:
http://wordpress.pastebin.com/HChQHFTx
Perhaps that will help.
Thanks so much!
My guess is that it’s lines 56-58 in loop.php:
# <?php if ( is_home() ) { query_posts($query_string . '&cat=-18'); }
I’d suggest creating an index.php file in your child theme and then placing the custom query just above
get_template_part( 'loop', 'index' );
. Be warned that I’ve not tried this approach myself (I’ve usually created a loop-foo.php template in the child for these situations) but it might work.You got it, esmi! Worked great! Thank you.
No problem 🙂
- The topic ‘Older Posts / Newer Posts Always Show Same Posts’ is closed to new replies.