Opened 20 years ago
Closed 20 years ago
#1252 closed defect (bug) (fixed)
patch for next_post() and previous_post() to honor "same_category" restriction
Reported by: | skippy | Owned by: | ryan |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | trivial | Version: | 1.5 |
Component: | Template | Keywords: | |
Focuses: | Cc: |
Description
The attached patch proposed to fix next_post() and previous_post() to allow them to be limited to the current post's category (/ categories).
Attachments (3)
Change History (6)
#3
@
20 years ago
get_next+previous_link.txt is a revised patch against get_next_post and get_previous_post, to constrain post selection to the current category.
#4
@
20 years ago
Cool. Updated patch to latest SVN. Used get_the_category() to get the list of categories so that we make use of the cache. Updated previous_post() and next_post() to use get_previous_post() and get_next_post().
Note: See
TracTickets for help on using
tickets.
next_post() and previous_post() are deprecated in favor of next_post_link() and previous_post_link(). This change needs to be made in get_next_post() and get_previous_post(). next_post() and previous_post() can be updated to use get_next_post() and get_previous_post().