Hi
try using a wp_query loop instead of get_posts
http://weblogtoolscollection.com/archives/2008/04/13/define-your-own-wordpress-loop-using-wp_query/
Also you will need this paging code in conjunction with the query statement
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$postlists = new WP_Query();
$postlists->query("paged=$paged&showposts=10&order=DESC&category=5&orderby=date');
while ($postlists->have_posts()) : $postlists->the_post(); ?>
==== do stuff ========
<?php endwhile; ?>
Information about getting post_nav_link to work is at the bottom of that article linked to above.
Aha – okay, making progress here!
I got stvwlf’s solution to work, and with a little tweaking it’s doing ALMOST what I want it to do! Thank you so much!
The one little nitpicky thing though is… now, the Previous and Next links are there, no matter what – even if there isn’t a “Next” or “Previous” post.
View this page: http://talk.girlsplan.org/blog/
and you’ll see there’s a “Next Entry” link, but since this page shows the most recent post, there wouldn’t be a “next.” If you click it, it shows a blank page. It’s not the end of the world, but my guess is my client will bring it up.
Is there a way to make that not happen?
Thanks again so much for your help! and Shane, thank you for your reply too… I didn’t try the plugin, was hoping to avoid using a plugin solution, but if this can’t work, that’s next on my list to try…
Kym
Oops, slight modification to my previous post. There isn’t a NEXT link on the most recent post; but I do get PREVIOUS links on the oldest post.
So if you go here: http://talk.girlsplan.org/blog/, hit previous, then hit previous again – you’ll be on the oldest post (there are only three). But the PREVIOUS link is still there, and if you click it, then I get the blank page.
Any suggestions welcome – thank you!
Kym
I have a problem with pagination too. Page 2 and above shows me a blank post. Page 1 is displaying correct posts.
Here is the link: http://gadgetforest.com
Can anyone please give me a hint?
having a similar issue, except when I hit the next link it displays the same posts again
here is the code I’m using:
<?php
$thequery = new WP_Query();
$thequery->query('category_name=featured'.'&paged='.$paged);
?>
<?php if($thequery->have_posts()) : while ($thequery->have_posts()) : $thequery->the_post(); ?>
=====do stuff======
<?php endwhile; ?>
<?php endif; ?>
I tried inserting the following:
<?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
but this didn’t seem to make a difference.
Anyone have any ideas?