Backwards Pagination?
-
So I am trying to have a type of countdown of top places to visit in my website and I am using the <!–nextpage–> code to have different pages but the only problem that the pages go from…
Pages 1,2,3 and so on. But I actually want it to start backwards, for example…
Pages 5,4,3,2,1
Is there any way to do this?
The blog I need help with is: (visible only to logged in users)
-
Hi,
Yes, you can easily do that. The example pagination at the bottom of the NextPage support page
has the code
1 <a href="https://en.support.wordpress.com/nextpage/2/">2</a> <a href="https://en.support.wordpress.com/nextpage/3/">3</a>
So to display the page numbers in reverse, just change the numbers to the following:
3 2 1I’m not sure the pagination will display here. Let’s try.
-
I almost got that right. Forgot to put the reverse code in code brackets. That should have been
So to display the page numbers in reverse, just change the numbers to the following:
3 <a href="https://en.support.wordpress.com/nextpage/2/">2</a> <a href="https://en.support.wordpress.com/nextpage/1/">1</a> -
The HTML code for reverse pagination with five page numbers would look like this:
5 <a href="https://en.support.wordpress.com/nextpage/4/">4</a> <a href="https://en.support.wordpress.com/nextpage/3/">3</a> <a href="https://en.support.wordpress.com/nextpage/2/">2</a> <a href="https://en.support.wordpress.com/nextpage/1/">1</a> -
Hey thanks for the reply. Not sure really what you meant since I’m a beginner in coding…
But what doing right now its adding <!–nextpage–> in the text part of a post and that creates a new page but not backwards.
Here is a picture of what it looks like in the editor, and the bottom one is what it looks like on the site
-
I’m sorry. I misunderstood what you were aiming to do. The NextPage tool can not be used to create a series of links between separate pages. Rather, it is a page or post splitting device. One page is split into two or more parts by inserting the <!–nextpage–> code strategically into the text editor of the page.
To create links to separate posts/pages at the bottom of the first post/page of a series is easy enough to accomplish, but not with NextPage. Use simple text links to create your link list.
For example, there are five posts in this forum, excluding this one. Here are numerical links to them:
5 4 3 2 1. -
The code for that series looks like this:
<a href="https://en.forums.wordpress.com/topic/backwards-pagination?replies=4#post-2509681">5</a> <a href="https://en.forums.wordpress.com/topic/backwards-pagination?replies=4#post-2509654">4</a> <a href="https://en.forums.wordpress.com/topic/backwards-pagination?replies=4#post-2509653">3</a> <a href="https://en.forums.wordpress.com/topic/backwards-pagination?replies=4#post-2509652">2</a> <a href="https://en.forums.wordpress.com/topic/backwards-pagination?replies=4#post-2509533">1</a>. -
-
Alternatively, you could easily make a link list of pages (or posts) in a text editor, using the “Insert/edit link” tool in the editor toolbar, and then copy and paste the list into a text widget to display in your sidebar.
-
@needhelptheme, what @musicdoc1 is describing is to create your own links at the bottom of each of your pages using HTML links. You would enter the number for the next page in your sequence at the bottom of the page, highlight it and then use the link tool in the editor to link that number to the next page. You would then do the same for each successive page.
There is no way to reverse the numbering using the <!–nextpage–> tag.
- The topic ‘Backwards Pagination?’ is closed to new replies.
