Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How can I implement pagination in backward style, like shown in the title.

(newest) first - 20 - 19 - 18 - ... - 3 - 2 - 1 - last (oldest)

I have search plugin, there are not yet plugin for this. Because I want static pagination result, for SEO, I hope I'm not wrong with this opinion.

Thank You.

EDIT

I try to explain with sample.

eg.: every page limit by 3 posts and have total 15 posts (total 5 pages). The position in Blog Home Default is page 5 (because the latest pages are 5). So the blog home display like this:

(date) - Title
**15** Jan 2011 - A dummy title
**14** Jan 2011 - A dummy title
**13** Jan 2011 - A dummy title
pagination display: (5) - 4 - 3 - 2 - 1

And if I click page 4, content entry not display correctly, it display like this:

(date) - Title
**06** Jan 2011 - A dummy title
**05** Jan 2011 - A dummy title
**04** Jan 2011 - A dummy title
pagination display: 5 - (4) - 3 - 2 - 1

Instead of that, page 4 should be like this:

**12** Jan 2011 - A dummy title
**11** Jan 2011 - A dummy title
**10** Jan 2011 - A dummy title
pagination display: 5 - (4) - 3 - 2 - 1

notes: I also put sample with date, to make it clear sample.

How can this will happen without touching the core Wordpress? Thank You.

share|improve this question

1 Answer 1

You could use wp_paginate_links(), pass it the 'type' => 'array' parameter in the argument array, and then array_reverse() the output.

But: if you're doing this for SEO purposes, don't bother. Your canonical URL should be your single-post view, not an archive index; so the index archive page numbers should have minimal SEO impact, no matter what order the page numbering.

EDIT

wp_paginate_links() Codex ref

EDIT 2

If you want to reverse the order of the posts themselves, you'll either need to use a custom query, or modify the default Loop query, likely by changing the $order from DESC to ASC.

EDIT 3

If you just want to reverse the order of the posts themselves, then just change $order from DESC to ASC, and don't do an array_reverse() on the wp_paginate_links() call.

share|improve this answer
    
Thank you! It works, but this only for the pagination display, the list loop content at page is still the same as before, I want the result also in backward, but NOT the order/sort of posts, it should be like normal, the newest is the first display (with LAST pagination number), and the latest is the oldest posts (with page ONE pagination number). Can this will happen without touching the core Wordpress? –  Jawaad Jun 28 '11 at 1:01
    
I mean if I go to page 1, the posts results is not the LATEST post, page 1 should be the latest posts. And the End of page should be the newest posts. It seems this will be so difficult to implement. –  Jawaad Jun 28 '11 at 1:10
    
See answer update. –  Chip Bennett Jun 28 '11 at 1:36
    
Thank you for the comment, but changing the $order from DESC to ASC will not display the newest in first display. I just want a normal display newest in the first display (define as last page number), the oldest latest display (define as page ONE). So I must keep $order with DESC. –  Jawaad Jun 28 '11 at 16:27
    
@Jawaad then you need to clarify what exactly you're after, because I no longer understand. –  Chip Bennett Jun 28 '11 at 16:29

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.