In y blog, when a user enters a single post page (a permalink) he is also presented with a next post/previous post links (Using the next_post_link/previous_post_link tags).
My problem is that those tags will not account for the context the user arrived from. There could be 4 different
types of those:
1. User came from default index page – in this case next/previous works correctly (phew..)
2. If the user came from a category page (showing just the posts in a particular category) then the next/previous post should only relate to that category.
3. If the user came from a search result page, the next/previous should navigate in the results space and not the entire posts space.
4. If the user chose a different sorting order (I allow sorting the index page by post ratings), then next/previous should respect the sorting order.
Is there a way for me to keep and re-use the query from the last page, and use that to figure out what are the next and previous posts?
- The topic ‘keep previous/next post query the same as main query’ is closed to new replies.