[wp-hackers] query_posts() issues

R.J. Kaplan just.be.happy at gmail.com
Tue Aug 1 15:42:29 GMT 2006


I'm trying to set up my single post page so that the previous and next posts
show in the sidebar, here's the code i'm using:

<?php
$prev = get_previous_post();
query_posts("p=$prev->ID&showposts=1");
?>
... the loop ...

<?php
$next = get_next_post();
query_posts("p=$next->ID&showposts=1");
?>
... the loop ...

the first query works fine, the second just shows the same post as the main
post on the page. if i reverse them, still it's only the first one that
works fine.
Any ideas?


More information about the wp-hackers mailing list