WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Every wp page has link structure like http:/site.com/?paged=1,2,3..50(last)

But how exchange it on http:/site.com/?paged=50,49,48..1(last)

share|improve this question
Question is not clear. – Denis de Bernardy Dec 12 '10 at 22:10
why would you want to do that? database starts counting from 1, and not from some number... how would you decide from which number to start? – pootzko Dec 12 '10 at 22:29
@Michail: I assume you are talking about paged lists, like archives? You want the earliest post always on the page numbered "1", so they stay the same, even if new posts appear? (Otherwise they get moved to next pages, which might be confusing if you follow an older link) – Jan Fabry Dec 13 '10 at 7:50

I think you can achieve this by first reversing the sorting order (filter posts_orderby), and then reversing the selected posts (filter the_posts). By doing this double reverse you circumvent the problem that you have to know the number of posts your query will return before you execute the query.

Keep in mind that WordPress (I think via the canonical rewriter) will remove the /page/1 part of your URL, so you should prevent this from happening. Also sticky posts might need attention. See the code for WP_Query::get_posts() for hooks to change the post query.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.