[wp-trac] Re: [WordPress Trac] #8107: get_next_post,
get_previous_post do not work for posts posted within same second
WordPress Trac
wp-trac at lists.automattic.com
Fri Apr 17 08:48:57 GMT 2009
#8107: get_next_post, get_previous_post do not work for posts posted within same
second
--------------------------+-------------------------------------------------
Reporter: whoismanu | Owner: anonymous
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Template | Version: 2.7
Severity: minor | Keywords: needs-patch
--------------------------+-------------------------------------------------
Changes (by Viper007Bond):
* component: General => Template
* severity: normal => minor
Comment:
Ooof, unless I'm missing something, this is a tricky patch.
The trick is to change the older/newer operator to older/newer OR exact
same time AND not the same post ID. That makes the same-time post show up
in the next/prev links, but the problem is you then get stuck in a loop,
i.e. you go from post A to post B and back to post A. You also can't do a
less-than/greater-than on the ID because IDs don't necessarily correspond
to the datetime (i.e. you could have older posts with IDs both higher and
lower than the current post).
As I said, seems to be pretty hard to get it not stuck in a loop.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/8107#comment:2>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list