I have a post in two categories, 1 and 2.
I want to get the previous post in the two categories, 1 and 2.
get_previous_post(true);
With that code I’m getting the previous post in category 1 or 2.
Any idea?
I have a post in two categories, 1 and 2.
I want to get the previous post in the two categories, 1 and 2.
get_previous_post(true);
With that code I’m getting the previous post in category 1 or 2.
Any idea?
You must be logged in to post a comment.
get_previous_post
usesget_adjacent_post()
which has a bunch of filter hooks you can use but a much simpler approach would be to create your own function, something like this: