I really need your help.
in my single.php I had to get the next post in the same category
(which i already have by:
$in_same_cat = true;
$excluded_categories = ”;
$previous = false;
$next_post = get_adjacent_post($in_same_cat,$excluded_categories,$previous);)
now I need the next next post and also in the opposite direction previous previous post
thanx
See answer here for some code that fetches several adjacent posts:
Getting the Next and Previous Posts Titles in the Sidebar?
Hi
Try to use the get_adjacent_post function according to this link
http://wordpress.org/support/topic/how-to-get-next-post-id
you can create a small loop that will get the ID of the next post and then use
the function again on the ID that you’ve received to get the next next ID.
this will bring the previous 4 posts.
http://wordpress.org/support/topic/get-next-5-posts-from-the-current-post
surprisingly,I found the answer myself…
I am using the same function as I used for next/previous post
(get_adjacent_post() )
but sending the the next/previous post which I already found as a parameter
but…we haven’t finished yet..
we need to add this code to the function declaration in wp-includes/link-template.php