• get_adjacent_post is the function WP now uses to have previous_post_link and such functions working.

    Anyway the ability to exclude a category when spewing the link is broken for me.

    To reproduce this problem just try having previous_post_link exclude one of the categories, like such:

    previous_post_link($format='« %link', $link='%title', $in_same_cat = false, $excluded_categories = '2')
    (or whatever category you want to exclude: it will be simply ignored.)

    The culprit is get_adjacent_post, but i find it totally complicated now so I just couldn’t fix it.

    Any ideas?

Viewing 16 replies (of 16 total)
  • Hi fellas,

    I’ve been looking for a solution all day, and damn is to say, I didn’t find nothing.

    I’d like to display only links to posts from the same subcategory, but it doesn’t seem to be working.

    I’ve investigated, and couldn’t go further than get_adjacent_post in link-template.php.

    I echoed $posts_in_ex_cats_sql to see what was in there and got:
    AND tt.taxonomy = ‘category’ AND tt.term_id NOT IN (5)

    which seems actually to be fine as 5 is, in this case, the one category I don’t want. (and in the other case, the “excluded” category is correctly 6).

    But, it doesn’t work: I’m still given the link to the next post, which is in the very category I don’t want.

    I’ve got version 2.7.x, from what I understand the problem has been here for a long time, and still not fixed, how come?

    And, has somebody any clue how to fix that? It doesn’t seem to be too complicated, but I’m just not good enough in php to go further.

    Thanks a lot for your help

Viewing 16 replies (of 16 total)
  • The topic ‘exclusion categories in get_adjacent_post just NOT WORKING in WP 2.5’ is closed to new replies.