next_post_link() and previous_post_link() should be allowed in the loop, even if is_single()
|Reported by:||jobjorn||Owned by:|
I'm building a custom theme where the front page (example.org) is essentially an exact duplicate of a single post (example.org/2009/09/post-title/). Imagine my confusion when I copied the contents of single.php over to index.php and finding that the navigation links had disappeared.
I promptly tracked down the culprit, and it turned out to be a requirement in get_adjacent_post: if !is_single, it returns null.
I see no reason as to why these links should not be allowed everywhere in the loop. The codex page even states it is allowed in the loop, not telling of the extra limitations. Unless there is some reason of which I am not aware, I suggest that the attached patch be applied.
Change History (12)
- Keywords 2nd-opinion added; themes the-loop removed
- Milestone changed from Unassigned to 3.0
- Resolution fixed deleted
- Severity changed from trivial to normal
- Status changed from closed to reopened