I wanted to implement a Next\Previous In Category link to replace the default Next/Previous links on my single post pages. Rather than change the wp function, I made the following changes in the theme:
In the bfa_next_previous_links.php code:
Find this function:
Code:
function bfa_next_previous_post_links($location = "Top")
Then in the two places where this code appears:
Code:
previous_post_link($bfa_ata['single_next_prev_older']) :
next_post_link($bfa_ata['single_next_prev_newer']);
Replace it with this code:
Code:
previous_post_link($bfa_ata['single_next_prev_older'],'%title',true) :
next_post_link($bfa_ata['single_next_prev_newer'],'%title',true);
The 'true' argument is the one that wp interprets to limit the navigation to the "current" category.
This seems to work ok in a blog where each post is associated with only one category. I haven't tested the behaviour where each post exists in multiple categories. I would hope there would be some persistence of category (but I'm not going to rely on it).
Nor have I thought too hard yet about pagination of posts so we're definitely into quick fix territory with this one!!
Can anyone see any problems with this approach?