[wp-trac] [WordPress Trac] #10867: next_post_link() and previous_post_link() should be allowed in the loop, even if is_single()

WordPress Trac wp-trac at lists.automattic.com
Sun Sep 27 19:03:33 UTC 2009


#10867: next_post_link() and previous_post_link() should be allowed in the loop,
even if is_single()
-------------------------+--------------------------------------------------
 Reporter:  jobjorn      |       Owner:                 
     Type:  enhancement  |      Status:  new            
 Priority:  low          |   Milestone:  Unassigned     
Component:  Themes       |     Version:                 
 Severity:  trivial      |    Keywords:  themes the-loop
-------------------------+--------------------------------------------------
 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.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10867>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list