How to implement pagination in backward way eg. first – 20 – 19 – 18 – … – 3 – 2 – 1 – last

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

(newest) first – 20 – 19 – 18 – … – 3 – 2 – 1 – last (oldest)

Read More

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.

Related posts

Leave a Reply

1 comment

  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.