WordPress的下一个/上一个项目

I've build myself a Wordpress theme with Ajax, my page currently consists of

Page 1
  portolio category 1
    item
    item
    item
Page 2
  portolio category 2
    item
    item
    item

I work with a global template that prints the page considering different conditions. For the Items ive build in a simple next/prev control with :

$previous_post = get_adjacent_post( false, '', true);
$next_post = get_adjacent_post( false, '', false);

next i am grabbing the id for the ajax link :

 . $previous_post->ID .

So now it works fine, but it gets the global adjacent posts on my website, but i want it to stay inside the category.

Switching to

$previous_post = get_adjacent_post( true, '', true);
    $next_post = get_adjacent_post( true, '', false);

as stated in the wordpress wiki, just doesn't work at all.

thanks for any advice you can give, tell me please if you need more information, it got way more complex than i wanted.

cheers

please try using

$previous_post = get_adjacent_post( true, '', true);

as described here Here

if it doesn't work then there is no previous post in the same category in your blog(technically).

and you can use this plugin for custom taxonomies link

Solved! get_adjacent_post does not work with the custom taxonomy i gave the portfolio elements. I fixed it with these (Taxonomies and this issue) and this plugin.