Opened 19 years ago
Closed 19 years ago
#2187 closed defect (bug) (fixed)
previous_post_link and next_post_link do not exclude specified category.
Reported by: | berko | Owned by: | |
---|---|---|---|
Milestone: | Priority: | high | |
Severity: | normal | Version: | 2.0 |
Component: | Template | Keywords: | |
Focuses: | Cc: |
Description
Category passed to previous_post_link and next_post_link is not actually excluded.
Change History (4)
#2
@
19 years ago
- Resolution invalid deleted
- Status changed from closed to reopened
In template-functions-links.php find this code:
function previous_post_link($format='« %link', $link='%title', $in_same_cat = false, $excluded_categories = '') {
When one specifies an excluded category, the category is not actually excluded from the navigation. Here is my template code. Category 2 is not excluded from my previous/next post navigation in single post view.
<div class="navigation"> <div class="alignleft"><?php previous_post_link('« %link', '%title', false, '2') ?></div> <div class="alignright"><?php next_post_link('%link »', '%title', false, '2') ?></div> </div>
Note: See
TracTickets for help on using
tickets.
Huh? Looking at the code for previous_post_link (next_... is similar):
There's no mention of category exclusion anywhere. Invalid, reopen if you can explain yourself :)